diff --git a/src/main/java/io/ipfs/api/IPFS.java b/src/main/java/io/ipfs/api/IPFS.java index 6e0f000..863e601 100644 --- a/src/main/java/io/ipfs/api/IPFS.java +++ b/src/main/java/io/ipfs/api/IPFS.java @@ -127,7 +127,7 @@ public List add(List files, boolean wrap, boolean h m.addSubtree(Paths.get(""), file); } else m.addFilePart("file", Paths.get(""), file); - }; + } String res = m.finish(); return JSONParser.parseStream(res).stream() .map(x -> MerkleNode.fromJSON((Map) x)) @@ -145,7 +145,7 @@ public List add(List files, AddArgs args) throws IO m.addSubtree(Paths.get(""), file); } else m.addFilePart("file", Paths.get(""), file); - }; + } String res = m.finish(); return JSONParser.parseStream(res).stream() .map(x -> MerkleNode.fromJSON((Map) x)) @@ -420,10 +420,8 @@ public Object peers(String topic) throws IOException { /** * - * @param topic + * @param topic topic to publish to * @param data url encoded data to be published - * @return - * @throws IOException */ public void pub(String topic, String data) { String encodedTopic = Multibase.encode(Multibase.Base.Base64Url, topic.getBytes()); @@ -471,7 +469,7 @@ public List codecs(boolean numeric, boolean supported) throws IOException } public Map format(Cid hash, Optional f, Optional v, Optional mc, Optional b) throws IOException { - String fArg = f.isPresent() ? "&f=" + URLEncoder.encode(f.get()) : ""; + String fArg = f.isPresent() ? "&f=" + URLEncoder.encode(f.get(), "UTF-8") : ""; String vArg = v.isPresent() ? "&v=" + v.get() : ""; String mcArg = mc.isPresent() ? "&mc=" + mc.get() : ""; String bArg = b.isPresent() ? "&b=" + b.get() : "";