From d05d526e4db3c92e6795c3e25648e159ae9a1473 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Fri, 10 Jul 2015 07:14:54 +0200 Subject: [PATCH] Use a String instead of a Key for redirects --- src/main/java/net/pterodactylus/fcp/quelaton/ClientPutCommand.java | 2 +- .../java/net/pterodactylus/fcp/quelaton/ClientPutCommandImpl.java | 4 ++-- .../java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/main/java/net/pterodactylus/fcp/quelaton/ClientPutCommand.java b/src/main/java/net/pterodactylus/fcp/quelaton/ClientPutCommand.java index bc8046f..231af10 100644 --- a/src/main/java/net/pterodactylus/fcp/quelaton/ClientPutCommand.java +++ b/src/main/java/net/pterodactylus/fcp/quelaton/ClientPutCommand.java @@ -14,7 +14,7 @@ import net.pterodactylus.fcp.Key; public interface ClientPutCommand { ClientPutCommand named(String targetFilename); - Keyed> redirectTo(Key key); + Keyed> redirectTo(String uri); Keyed> from(File file); Lengthed>> from(InputStream inputStream); diff --git a/src/main/java/net/pterodactylus/fcp/quelaton/ClientPutCommandImpl.java b/src/main/java/net/pterodactylus/fcp/quelaton/ClientPutCommandImpl.java index eab1632..39d525a 100644 --- a/src/main/java/net/pterodactylus/fcp/quelaton/ClientPutCommandImpl.java +++ b/src/main/java/net/pterodactylus/fcp/quelaton/ClientPutCommandImpl.java @@ -54,8 +54,8 @@ class ClientPutCommandImpl implements ClientPutCommand { } @Override - public Keyed> redirectTo(Key key) { - this.redirectUri.set(Objects.requireNonNull(key, "key must not be null").getKey()); + public Keyed> redirectTo(String uri) { + this.redirectUri.set(Objects.requireNonNull(uri, "uri must not be null")); return this::key; } diff --git a/src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java b/src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java index b547ca7..6af103c 100644 --- a/src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java +++ b/src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java @@ -365,7 +365,7 @@ public class DefaultFcpClientTest { @Test public void clientPutWithRedirectSendsCorrectCommand() throws IOException, ExecutionException, InterruptedException { - fcpClient.clientPut().redirectTo(new Key("KSK@bar.txt")).key(new Key("KSK@foo.txt")); + fcpClient.clientPut().redirectTo("KSK@bar.txt").key(new Key("KSK@foo.txt")); connectNode(); List lines = fcpServer.collectUntil(is("EndMessage")); assertThat(lines, -- 2.7.4