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);
+
+ }
}
}
@Override
- public WithUri<Executable<Optional<Key>>> redirectTo(String uri) {
+ public WithUri redirectTo(String uri) {
this.redirectUri.set(Objects.requireNonNull(uri, "uri must not be null"));
return this::key;
}
@Override
- public WithUri<Executable<Optional<Key>>> from(File file) {
+ public WithUri from(File file) {
this.file.set(Objects.requireNonNull(file, "file must not be null"));
return this::key;
}
@Override
- public WithLength<WithUri<Executable<Optional<Key>>>> from(InputStream inputStream) {
+ public WithLength from(InputStream inputStream) {
payload.set(Objects.requireNonNull(inputStream, "inputStream must not be null"));
return this::length;
}
- private WithUri<Executable<Optional<Key>>> length(long length) {
+ private WithUri length(long length) {
this.length.set(length);
return this::key;
}
+++ /dev/null
-package net.pterodactylus.fcp.quelaton;
-
-/**
- * An intermediary interface for FCP commands that require a length parameter.
- *
- * @param <R>
- * The type of the next command part
- * @author <a href="mailto:bombe@freenetproject.org">David ‘Bombe’ Roden</a>
- */
-public interface WithLength<R> {
-
- R length(long length);
-
-}
+++ /dev/null
-package net.pterodactylus.fcp.quelaton;
-
-/**
- * The terminal operation of an FCP command, requiring a Freenet URI.
- *
- * @param <R>
- * The type of the command result
- * @author <a href="mailto:bombe@freenetproject.org">David ‘Bombe’ Roden</a>
- */
-public interface WithUri<R> {
-
- R uri(String uri);
-
-}