Add progress consumer to ClientPut command
[jFCPlib.git] / src / main / java / net / pterodactylus / fcp / quelaton / ClientPutCommand.java
index 41c2377..3fc5767 100644 (file)
@@ -6,6 +6,7 @@ import java.util.Optional;
 import java.util.function.Consumer;
 
 import net.pterodactylus.fcp.Key;
+import net.pterodactylus.fcp.RequestProgress;
 
 /**
  * FCP command that inserts data into Freenet.
@@ -14,10 +15,23 @@ import net.pterodactylus.fcp.Key;
  */
 public interface ClientPutCommand {
 
+       ClientPutCommand onProgress(Consumer<RequestProgress> requestProgressConsumer);
        ClientPutCommand onKeyGenerated(Consumer<String> keyGenerated);
        ClientPutCommand named(String targetFilename);
-       WithUri<Executable<Optional<Key>>> redirectTo(String uri);
-       WithUri<Executable<Optional<Key>>> from(File file);
-       WithLength<WithUri<Executable<Optional<Key>>>> from(InputStream inputStream);
+       WithUri redirectTo(String uri);
+       WithUri from(File file);
+       WithLength from(InputStream inputStream);
+
+       interface WithLength {
+
+               WithUri length(long length);
+
+       }
+
+       interface WithUri {
+
+               Executable<Optional<Key>> uri(String uri);
+
+       }
 
 }