diff --git a/src/main/java/org/RI/P2/Indexer.java b/src/main/java/org/RI/P2/Indexer.java index b6fc78a..563b390 100644 --- a/src/main/java/org/RI/P2/Indexer.java +++ b/src/main/java/org/RI/P2/Indexer.java @@ -45,10 +45,13 @@ public class Indexer { JSONArray parseJSONFile(String filePath) throws IOException, ParseException { InputStream jsonFile = getClass().getResourceAsStream(filePath); + JSONArray parseJSONFile(File file) throws IOException { + InputStream jsonFile = new FileInputStream(file); Reader readerJson = new InputStreamReader(jsonFile); - Object fileObjects = JSONValue.parse(readerJson); - JSONArray arrayObjects = (JSONArray) fileObjects; - return arrayObjects; + Object fileObject = JSONValue.parse(readerJson); + JSONArray arrayObject = new JSONArray(); + arrayObject.add(fileObject); + return arrayObject; } void openIndex() throws IOException {