package net.pterodactylus.fcp.quelaton;
+import java.io.File;
import java.net.URL;
import java.util.Optional;
*
* @author <a href="mailto:bombe@freenetproject.org">David ‘Bombe’ Roden</a>
*/
-public interface AddPeerCommand extends WithFile<Executable<Optional<Peer>>> {
+public interface AddPeerCommand {
+ Executable<Optional<Peer>> fromFile(File file);
Executable<Optional<Peer>> fromURL(URL url);
}
}
@Override
- public Executable<Optional<Peer>> withFile(File file) {
+ public Executable<Optional<Peer>> fromFile(File file) {
this.file.set(file);
return this::execute;
}
@Test
public void defaultFcpClientCanAddPeerFromFile() throws InterruptedException, ExecutionException, IOException {
- Future<Optional<Peer>> peer = fcpClient.addPeer().withFile(new File("/tmp/ref.txt")).execute();
+ Future<Optional<Peer>> peer = fcpClient.addPeer().fromFile(new File("/tmp/ref.txt")).execute();
connectNode();
List<String> lines = fcpServer.collectUntil(is("EndMessage"));
String identifier = extractIdentifier(lines);