Skip to content

Commit

Permalink
Closing inputstream
Browse files Browse the repository at this point in the history
  • Loading branch information
enridaga committed Apr 15, 2021
1 parent ec8d86e commit 649dab3
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.github.spiceh2020.sparql.anything.json;

import java.io.IOException;
import java.io.InputStream;
import java.net.URL;
import java.util.List;
import java.util.Map;
Expand Down Expand Up @@ -32,10 +33,16 @@ public class JSONTriplifier implements Triplifier {
private void transformJSONFromURL(URL url, String rootId, FacadeXGraphBuilder filter) throws IOException {
JsonIterator.setMode(DecodingMode.DYNAMIC_MODE_AND_MATCH_FIELD_WITH_HASH);
JsonStream.setMode(EncodingMode.DYNAMIC_MODE);

// JsonIterator json = JsonIterator.parse(url.openStream().readAllBytes());
JsonIterator json = JsonIterator.parse(BUFF);
json.reset(url.openStream());
transformJSON(json, url.toString(), rootId, filter);
final InputStream stream = url.openStream();
try {
json.reset(stream);
transformJSON(json, url.toString(), rootId, filter);
}finally{
stream.close();
}
}

// private void any(String jsoon)
Expand Down

0 comments on commit 649dab3

Please sign in to comment.