File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed
src/main/java/io/ipfs/api Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change @@ -60,6 +60,41 @@ public Optional<String> getName() {
60
60
}
61
61
}
62
62
63
+ class InputStreamWrapper implements NamedStreamable {
64
+ private final Optional <String > name ;
65
+ private final InputStream data ;
66
+
67
+ public InputStreamWrapper (InputStream data ) {
68
+ this (Optional .empty (), data );
69
+ }
70
+
71
+ public InputStreamWrapper (String name , InputStream data ) {
72
+ this (Optional .of (name ), data );
73
+ }
74
+
75
+ public InputStreamWrapper (Optional <String > name , InputStream data ) {
76
+ this .name = name ;
77
+ this .data = data ;
78
+ }
79
+
80
+ public boolean isDirectory () {
81
+ return false ;
82
+ }
83
+
84
+ public InputStream getInputStream () {
85
+ return data ;
86
+ }
87
+
88
+ @ Override
89
+ public List <NamedStreamable > getChildren () {
90
+ return Collections .emptyList ();
91
+ }
92
+
93
+ public Optional <String > getName () {
94
+ return name ;
95
+ }
96
+ }
97
+
63
98
class ByteArrayWrapper implements NamedStreamable {
64
99
private final Optional <String > name ;
65
100
private final byte [] data ;
You can’t perform that action at this time.
0 commit comments