projects
/
jFCPlib.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
6d1aae4
)
Inline interfaces used in ClientPut
author
David ‘Bombe’ Roden
<bombe@freenetproject.org>
Mon, 13 Jul 2015 16:21:15 +0000
(18:21 +0200)
committer
David ‘Bombe’ Roden
<bombe@freenetproject.org>
Mon, 13 Jul 2015 16:21:15 +0000
(18:21 +0200)
src/main/java/net/pterodactylus/fcp/quelaton/ClientPutCommand.java
patch
|
blob
|
history
src/main/java/net/pterodactylus/fcp/quelaton/ClientPutCommandImpl.java
patch
|
blob
|
history
src/main/java/net/pterodactylus/fcp/quelaton/WithLength.java
[deleted file]
patch
|
blob
|
history
src/main/java/net/pterodactylus/fcp/quelaton/WithUri.java
[deleted file]
patch
|
blob
|
history
diff --git
a/src/main/java/net/pterodactylus/fcp/quelaton/ClientPutCommand.java
b/src/main/java/net/pterodactylus/fcp/quelaton/ClientPutCommand.java
index
41c2377
..
7e900f2
100644
(file)
--- a/
src/main/java/net/pterodactylus/fcp/quelaton/ClientPutCommand.java
+++ b/
src/main/java/net/pterodactylus/fcp/quelaton/ClientPutCommand.java
@@
-16,8
+16,20
@@
public interface ClientPutCommand {
ClientPutCommand onKeyGenerated(Consumer<String> keyGenerated);
ClientPutCommand named(String targetFilename);
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);
+
+ }
}
}
diff --git
a/src/main/java/net/pterodactylus/fcp/quelaton/ClientPutCommandImpl.java
b/src/main/java/net/pterodactylus/fcp/quelaton/ClientPutCommandImpl.java
index
1b322f3
..
06d54e0
100644
(file)
--- a/
src/main/java/net/pterodactylus/fcp/quelaton/ClientPutCommandImpl.java
+++ b/
src/main/java/net/pterodactylus/fcp/quelaton/ClientPutCommandImpl.java
@@
-66,24
+66,24
@@
class ClientPutCommandImpl implements ClientPutCommand {
}
@Override
}
@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
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
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;
}
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;
}
this.length.set(length);
return this::key;
}
diff --git
a/src/main/java/net/pterodactylus/fcp/quelaton/WithLength.java
b/src/main/java/net/pterodactylus/fcp/quelaton/WithLength.java
deleted file mode 100644
(file)
index
8d38bf3
..0000000
--- a/
src/main/java/net/pterodactylus/fcp/quelaton/WithLength.java
+++ /dev/null
@@
-1,14
+0,0 @@
-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);
-
-}
diff --git
a/src/main/java/net/pterodactylus/fcp/quelaton/WithUri.java
b/src/main/java/net/pterodactylus/fcp/quelaton/WithUri.java
deleted file mode 100644
(file)
index
daaae52
..0000000
--- a/
src/main/java/net/pterodactylus/fcp/quelaton/WithUri.java
+++ /dev/null
@@
-1,14
+0,0 @@
-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);
-
-}