Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/main/java/io/ipfs/api/IPFS.java
Original file line number Diff line number Diff line change
Expand Up @@ -93,24 +93,24 @@ public List<MerkleNode> add(List<NamedStreamable> files, boolean wrap, boolean h
}

public List<MerkleNode> ls(Multihash hash) throws IOException {
Map res = retrieveMap("ls/" + hash);
Map res = retrieveMap("ls?arg=" + hash);
return ((List<Object>) res.get("Objects")).stream().map(x -> MerkleNode.fromJSON((Map) x)).collect(Collectors.toList());
}

public byte[] cat(Multihash hash) throws IOException {
return retrieve("cat/" + hash);
return retrieve("cat?arg=" + hash);
}

public byte[] cat(Multihash hash, String subPath) throws IOException {
return retrieve("cat?arg=" + hash + URLEncoder.encode(subPath, "UTF-8"));
}

public byte[] get(Multihash hash) throws IOException {
return retrieve("get/" + hash);
return retrieve("get?arg=" + hash);
}

public InputStream catStream(Multihash hash) throws IOException {
return retrieveStream("cat/" + hash);
return retrieveStream("cat?arg=" + hash);
}

public List<Multihash> refs(Multihash hash, boolean recursive) throws IOException {
Expand Down