@@ -94,15 +94,15 @@ public Map mount(java.io.File ipfsRoot, java.io.File ipnsRoot) throws IOExceptio
9494 }
9595
9696 // level 2 commands
97- class Refs {
97+ public class Refs {
9898 public List <Multihash > local () throws IOException {
9999 return Arrays .asList (new String (retrieve ("refs/local" )).split ("\n " )).stream ().map (Multihash ::fromBase58 ).collect (Collectors .toList ());
100100 }
101101 }
102102
103103 /* Pinning an object ensures a local copy of it is kept.
104104 */
105- class Pin {
105+ public class Pin {
106106 public List <Multihash > add (Multihash hash ) throws IOException {
107107 return ((List <Object >)((Map )retrieveAndParse ("pin/add?stream-channels=true&arg=" + hash )).get ("Pinned" ))
108108 .stream ()
@@ -132,15 +132,15 @@ public List<Multihash> rm(Multihash hash, boolean recursive) throws IOException
132132
133133 /* 'ipfs repo' is a plumbing command used to manipulate the repo.
134134 */
135- class Repo {
135+ public class Repo {
136136 public Object gc () throws IOException {
137137 return retrieveAndParse ("repo/gc" );
138138 }
139139 }
140140
141141 /* 'ipfs block' is a plumbing command used to manipulate raw ipfs blocks.
142142 */
143- class Block {
143+ public class Block {
144144 public byte [] get (Multihash hash ) throws IOException {
145145 return retrieve ("block/get?stream-channels=true&arg=" + hash );
146146 }
@@ -160,7 +160,7 @@ public Map stat(Multihash hash) throws IOException {
160160
161161 /* 'ipfs object' is a plumbing command used to manipulate DAG objects directly. {Object} is a subset of {Block}
162162 */
163- class IPFSObject {
163+ public class IPFSObject {
164164 public List <MerkleNode > put (List <byte []> data ) throws IOException {
165165 Multipart m = new Multipart ("http://" + host + ":" + port + version +"object/put?stream-channels=true" , "UTF-8" );
166166 for (byte [] f : data )
@@ -198,7 +198,7 @@ public MerkleNode _new(Optional<String> template) throws IOException {
198198 // TODO patch
199199 }
200200
201- class Name {
201+ public class Name {
202202 public Map publish (Multihash hash ) throws IOException {
203203 return publish (Optional .empty (), hash );
204204 }
@@ -213,7 +213,7 @@ public String resolve(Multihash hash) throws IOException {
213213 }
214214 }
215215
216- class DHT {
216+ public class DHT {
217217 public Map findprovs (Multihash hash ) throws IOException {
218218 return retrieveMap ("dht/findprovs?arg=" + hash );
219219 }
@@ -235,7 +235,7 @@ public Map put(String key, String value) throws IOException {
235235 }
236236 }
237237
238- class File {
238+ public class File {
239239 public Map ls (Multihash path ) throws IOException {
240240 return retrieveMap ("file/ls?arg=" + path );
241241 }
@@ -247,7 +247,7 @@ public List<MultiAddress> bootstrap() throws IOException {
247247 return ((List <String >)retrieveMap ("bootstrap/" ).get ("Peers" )).stream ().map (x -> new MultiAddress (x )).collect (Collectors .toList ());
248248 }
249249
250- class Bootstrap {
250+ public class Bootstrap {
251251 public List <MultiAddress > list () throws IOException {
252252 return bootstrap ();
253253 }
@@ -269,7 +269,7 @@ public List<MultiAddress> rm(MultiAddress addr, boolean all) throws IOException
269269 component that opens, listens for, and maintains connections to other
270270 ipfs peers in the internet.
271271 */
272- class Swarm {
272+ public class Swarm {
273273 public List <MultiAddress > peers () throws IOException {
274274 Map m = retrieveMap ("swarm/peers?stream-channels=true" );
275275 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 {
291291 }
292292 }
293293
294- class Diag {
294+ public class Diag {
295295 public String net () throws IOException {
296296 return new String (retrieve ("diag/net?stream-channels=true" ));
297297 }
@@ -305,7 +305,7 @@ public Map id(String target) throws IOException {
305305 return retrieveMap ("id/" + target .toString ());
306306 }
307307
308- class Stats {
308+ public class Stats {
309309 public Map bw () throws IOException {
310310 return retrieveMap ("stats/bw" );
311311 }
@@ -325,7 +325,7 @@ public Map log() throws IOException {
325325 return retrieveMap ("log/tail" );
326326 }
327327
328- class Config {
328+ public class Config {
329329 public Map show () throws IOException {
330330 return (Map )retrieveAndParse ("config/show" );
331331 }
@@ -350,7 +350,7 @@ public Object update() throws IOException {
350350 return retrieveAndParse ("update" );
351351 }
352352
353- class Update {
353+ public class Update {
354354 public Object check () throws IOException {
355355 return retrieveAndParse ("update/check" );
356356 }
0 commit comments