From: David ‘Bombe’ Roden Date: Sun, 1 Mar 2020 09:36:04 +0000 (+0100) Subject: ✨ Add method to send ModifyConfig request X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=9a8d386e3b73f5ed509e5db7b0c5811be78399d6;p=jFCPlib.git ✨ Add method to send ModifyConfig request --- diff --git a/src/main/java/net/pterodactylus/fcp/highlevel/FcpClient.java b/src/main/java/net/pterodactylus/fcp/highlevel/FcpClient.java index 274852a..473fe98 100644 --- a/src/main/java/net/pterodactylus/fcp/highlevel/FcpClient.java +++ b/src/main/java/net/pterodactylus/fcp/highlevel/FcpClient.java @@ -59,6 +59,7 @@ import net.pterodactylus.fcp.GetNode; import net.pterodactylus.fcp.ListPeerNotes; import net.pterodactylus.fcp.ListPeers; import net.pterodactylus.fcp.ListPersistentRequests; +import net.pterodactylus.fcp.ModifyConfig; import net.pterodactylus.fcp.ModifyPeer; import net.pterodactylus.fcp.ModifyPeerNote; import net.pterodactylus.fcp.NodeData; @@ -1174,6 +1175,22 @@ public class FcpClient implements Closeable { return results; } + public void modifyConfig(Map options) throws IOException, FcpException { + new ExtendedFcpAdapter() { + @Override + public void run() throws IOException { + ModifyConfig modifyConfig = new ModifyConfig(); + options.forEach(modifyConfig::setOption); + sendMessage(modifyConfig); + } + + @Override + public void receivedConfigData(FcpConnection fcpConnection, ConfigData configData) { + complete(); + } + }.execute(); + } + // // PRIVATE METHODS //