@@ -94,15 +94,15 @@ public Map mount(java.io.File ipfsRoot, java.io.File ipnsRoot) throws IOExceptio
94
94
}
95
95
96
96
// level 2 commands
97
- class Refs {
97
+ public class Refs {
98
98
public List <Multihash > local () throws IOException {
99
99
return Arrays .asList (new String (retrieve ("refs/local" )).split ("\n " )).stream ().map (Multihash ::fromBase58 ).collect (Collectors .toList ());
100
100
}
101
101
}
102
102
103
103
/* Pinning an object ensures a local copy of it is kept.
104
104
*/
105
- class Pin {
105
+ public class Pin {
106
106
public List <Multihash > add (Multihash hash ) throws IOException {
107
107
return ((List <Object >)((Map )retrieveAndParse ("pin/add?stream-channels=true&arg=" + hash )).get ("Pinned" ))
108
108
.stream ()
@@ -132,15 +132,15 @@ public List<Multihash> rm(Multihash hash, boolean recursive) throws IOException
132
132
133
133
/* 'ipfs repo' is a plumbing command used to manipulate the repo.
134
134
*/
135
- class Repo {
135
+ public class Repo {
136
136
public Object gc () throws IOException {
137
137
return retrieveAndParse ("repo/gc" );
138
138
}
139
139
}
140
140
141
141
/* 'ipfs block' is a plumbing command used to manipulate raw ipfs blocks.
142
142
*/
143
- class Block {
143
+ public class Block {
144
144
public byte [] get (Multihash hash ) throws IOException {
145
145
return retrieve ("block/get?stream-channels=true&arg=" + hash );
146
146
}
@@ -160,7 +160,7 @@ public Map stat(Multihash hash) throws IOException {
160
160
161
161
/* 'ipfs object' is a plumbing command used to manipulate DAG objects directly. {Object} is a subset of {Block}
162
162
*/
163
- class IPFSObject {
163
+ public class IPFSObject {
164
164
public List <MerkleNode > put (List <byte []> data ) throws IOException {
165
165
Multipart m = new Multipart ("http://" + host + ":" + port + version +"object/put?stream-channels=true" , "UTF-8" );
166
166
for (byte [] f : data )
@@ -198,7 +198,7 @@ public MerkleNode _new(Optional<String> template) throws IOException {
198
198
// TODO patch
199
199
}
200
200
201
- class Name {
201
+ public class Name {
202
202
public Map publish (Multihash hash ) throws IOException {
203
203
return publish (Optional .empty (), hash );
204
204
}
@@ -213,7 +213,7 @@ public String resolve(Multihash hash) throws IOException {
213
213
}
214
214
}
215
215
216
- class DHT {
216
+ public class DHT {
217
217
public Map findprovs (Multihash hash ) throws IOException {
218
218
return retrieveMap ("dht/findprovs?arg=" + hash );
219
219
}
@@ -235,7 +235,7 @@ public Map put(String key, String value) throws IOException {
235
235
}
236
236
}
237
237
238
- class File {
238
+ public class File {
239
239
public Map ls (Multihash path ) throws IOException {
240
240
return retrieveMap ("file/ls?arg=" + path );
241
241
}
@@ -247,7 +247,7 @@ public List<MultiAddress> bootstrap() throws IOException {
247
247
return ((List <String >)retrieveMap ("bootstrap/" ).get ("Peers" )).stream ().map (x -> new MultiAddress (x )).collect (Collectors .toList ());
248
248
}
249
249
250
- class Bootstrap {
250
+ public class Bootstrap {
251
251
public List <MultiAddress > list () throws IOException {
252
252
return bootstrap ();
253
253
}
@@ -269,7 +269,7 @@ public List<MultiAddress> rm(MultiAddress addr, boolean all) throws IOException
269
269
component that opens, listens for, and maintains connections to other
270
270
ipfs peers in the internet.
271
271
*/
272
- class Swarm {
272
+ public class Swarm {
273
273
public List <MultiAddress > peers () throws IOException {
274
274
Map m = retrieveMap ("swarm/peers?stream-channels=true" );
275
275
return ((List <Object >)m .get ("Strings" )).stream ().map (x -> new MultiAddress ((String )x )).collect (Collectors .toList ());
@@ -291,7 +291,7 @@ public Map disconnect(String multiAddr) throws IOException {
291
291
}
292
292
}
293
293
294
- class Diag {
294
+ public class Diag {
295
295
public String net () throws IOException {
296
296
return new String (retrieve ("diag/net?stream-channels=true" ));
297
297
}
@@ -305,7 +305,7 @@ public Map id(String target) throws IOException {
305
305
return retrieveMap ("id/" + target .toString ());
306
306
}
307
307
308
- class Stats {
308
+ public class Stats {
309
309
public Map bw () throws IOException {
310
310
return retrieveMap ("stats/bw" );
311
311
}
@@ -325,7 +325,7 @@ public Map log() throws IOException {
325
325
return retrieveMap ("log/tail" );
326
326
}
327
327
328
- class Config {
328
+ public class Config {
329
329
public Map show () throws IOException {
330
330
return (Map )retrieveAndParse ("config/show" );
331
331
}
@@ -350,7 +350,7 @@ public Object update() throws IOException {
350
350
return retrieveAndParse ("update" );
351
351
}
352
352
353
- class Update {
353
+ public class Update {
354
354
public Object check () throws IOException {
355
355
return retrieveAndParse ("update/check" );
356
356
}
0 commit comments