From: David ‘Bombe’ Roden Date: Sat, 11 Jul 2015 17:03:37 +0000 (+0200) Subject: Rename method to add peer from a file X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=6871db2ad88d2a1941341ffbc453c627590b8431;p=jFCPlib.git Rename method to add peer from a file --- diff --git a/src/main/java/net/pterodactylus/fcp/quelaton/AddPeerCommand.java b/src/main/java/net/pterodactylus/fcp/quelaton/AddPeerCommand.java index 8b7a7bb..5997af6 100644 --- a/src/main/java/net/pterodactylus/fcp/quelaton/AddPeerCommand.java +++ b/src/main/java/net/pterodactylus/fcp/quelaton/AddPeerCommand.java @@ -1,5 +1,6 @@ package net.pterodactylus.fcp.quelaton; +import java.io.File; import java.net.URL; import java.util.Optional; @@ -10,8 +11,9 @@ import net.pterodactylus.fcp.Peer; * * @author David ‘Bombe’ Roden */ -public interface AddPeerCommand extends WithFile>> { +public interface AddPeerCommand { + Executable> fromFile(File file); Executable> fromURL(URL url); } diff --git a/src/main/java/net/pterodactylus/fcp/quelaton/AddPeerCommandImpl.java b/src/main/java/net/pterodactylus/fcp/quelaton/AddPeerCommandImpl.java index fbfb314..a4f4452 100644 --- a/src/main/java/net/pterodactylus/fcp/quelaton/AddPeerCommandImpl.java +++ b/src/main/java/net/pterodactylus/fcp/quelaton/AddPeerCommandImpl.java @@ -35,7 +35,7 @@ public class AddPeerCommandImpl implements AddPeerCommand { } @Override - public Executable> withFile(File file) { + public Executable> fromFile(File file) { this.file.set(file); return this::execute; } diff --git a/src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java b/src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java index 574f4d7..840e601 100644 --- a/src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java +++ b/src/test/java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java @@ -1001,7 +1001,7 @@ public class DefaultFcpClientTest { @Test public void defaultFcpClientCanAddPeerFromFile() throws InterruptedException, ExecutionException, IOException { - Future> peer = fcpClient.addPeer().withFile(new File("/tmp/ref.txt")).execute(); + Future> peer = fcpClient.addPeer().fromFile(new File("/tmp/ref.txt")).execute(); connectNode(); List lines = fcpServer.collectUntil(is("EndMessage")); String identifier = extractIdentifier(lines);