From 6871db2ad88d2a1941341ffbc453c627590b8431 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sat, 11 Jul 2015 19:03:37 +0200 Subject: [PATCH] Rename method to add peer from a file --- src/main/java/net/pterodactylus/fcp/quelaton/AddPeerCommand.java | 4 +++- src/main/java/net/pterodactylus/fcp/quelaton/AddPeerCommandImpl.java | 2 +- .../java/net/pterodactylus/fcp/quelaton/DefaultFcpClientTest.java | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) 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); -- 2.7.4