Add progress consumer to ClientPut command
[jFCPlib.git] / src / main / java / net / pterodactylus / fcp / quelaton / ClientPutCommand.java
1 package net.pterodactylus.fcp.quelaton;
2
3 import java.io.File;
4 import java.io.InputStream;
5 import java.util.Optional;
6 import java.util.function.Consumer;
7
8 import net.pterodactylus.fcp.Key;
9 import net.pterodactylus.fcp.RequestProgress;
10
11 /**
12  * FCP command that inserts data into Freenet.
13  *
14  * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
15  */
16 public interface ClientPutCommand {
17
18         ClientPutCommand onProgress(Consumer<RequestProgress> requestProgressConsumer);
19         ClientPutCommand onKeyGenerated(Consumer<String> keyGenerated);
20         ClientPutCommand named(String targetFilename);
21         WithUri redirectTo(String uri);
22         WithUri from(File file);
23         WithLength from(InputStream inputStream);
24
25         interface WithLength {
26
27                 WithUri length(long length);
28
29         }
30
31         interface WithUri {
32
33                 Executable<Optional<Key>> uri(String uri);
34
35         }
36
37 }