Follow redirects in ClientGet
[jFCPlib.git] / src / main / java / net / pterodactylus / fcp / quelaton / ClientGetCommand.java
1 package net.pterodactylus.fcp.quelaton;
2
3 import java.io.InputStream;
4 import java.util.Optional;
5 import java.util.function.Consumer;
6
7 import net.pterodactylus.fcp.Priority;
8
9 /**
10  * Command that retrieves data from Freenet.
11  *
12  * @author <a href="mailto:bombe@pterodactylus.net">David ‘Bombe’ Roden</a>
13  */
14 public interface ClientGetCommand {
15
16         ClientGetCommand onRedirect(Consumer<String> onRedirect);
17         ClientGetCommand ignoreDataStore();
18         ClientGetCommand dataStoreOnly();
19         ClientGetCommand maxSize(long maxSize);
20         ClientGetCommand priority(Priority priority);
21         ClientGetCommand realTime();
22         ClientGetCommand global();
23
24         Executable<Optional<Data>> uri(String uri);
25
26         interface Data {
27
28                 String getMimeType();
29                 long size();
30                 InputStream getInputStream();
31
32         }
33
34 }