From: David ‘Bombe’ Roden Date: Fri, 10 Jul 2015 05:14:54 +0000 (+0200) Subject: Use a String instead of a Key for redirects X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=d05d526e4db3c92e6795c3e25648e159ae9a1473;p=jFCPlib.git Use a String instead of a Key for redirects --- 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,