Skip to content

Commit 2f3b5dd

Browse files
committed
add items to filestore api
1 parent 3d9db3b commit 2f3b5dd

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

src/main/java/io/ipfs/api/IPFS.java

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ public enum PinType {all, direct, indirect, recursive}
4545
public final DHT dht = new DHT();
4646
public final File file = new File();
4747
public final Files files = new Files();
48+
public final FileStore fileStore = new FileStore();
4849
public final Stats stats = new Stats();
4950
public final Name name = new Name();
5051
public final Pubsub pubsub = new Pubsub();
@@ -592,6 +593,21 @@ public String write(String path, NamedStreamable uploadFile, boolean create, boo
592593
}
593594
}
594595

596+
public class FileStore {
597+
598+
public Map dups() throws IOException {
599+
return retrieveMap("filestore/dups");
600+
}
601+
602+
public Map ls() throws IOException {
603+
return retrieveMap("filestore/ls");
604+
}
605+
606+
public Map verify() throws IOException {
607+
return retrieveMap("filestore/verify");
608+
}
609+
}
610+
595611
// Network commands
596612
public List<MultiAddress> bootstrap() throws IOException {
597613
return ((List<String>)retrieveMap("bootstrap/").get("Peers"))

src/test/java/io/ipfs/api/APITest.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,15 @@ public void filesTest() throws IOException {
262262
String cid = ipfs.files.chcid(copyToPath);
263263
ipfs.files.rm("/filesTest", true, true);
264264
}
265+
266+
@Test
267+
@Ignore("Experimental feature not enabled by default")
268+
public void fileStoreTest() throws IOException {
269+
ipfs.fileStore.dups();
270+
ipfs.fileStore.ls();
271+
ipfs.fileStore.verify();
272+
}
273+
265274
@Test
266275
public void pinTest() throws IOException {
267276
MerkleNode file = ipfs.add(new NamedStreamable.ByteArrayWrapper("some data".getBytes())).get(0);

0 commit comments

Comments
 (0)