diff options
author | j-james | 2022-10-29 04:43:06 +0000 |
---|---|---|
committer | j-james | 2022-10-29 04:43:06 +0000 |
commit | 402b25d25e91048e284513c19300cdad42054ff8 (patch) | |
tree | 0abcc860d7520ee2fbcd9e67b5ec13da4fc744e4 | |
parent | fb04947b701d80cd9730e3aa0b7afe7a4bb196f6 (diff) |
WHY is the autobot still on Java 8
-rw-r--r-- | src/main/persistance/JsonUtils.java | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/persistance/JsonUtils.java b/src/main/persistance/JsonUtils.java index 4e11a18..c97e5fd 100644 --- a/src/main/persistance/JsonUtils.java +++ b/src/main/persistance/JsonUtils.java @@ -29,11 +29,13 @@ public class JsonUtils { * REQUIRES: a path to a valid file containing JSONObject-serialized data * EFFECTS: reads a serialized String into a JSONObject */ - public static JSONArray readFromFile(String path) { + public static JSONArray readFromFile(String pathString) { String content; JSONArray deread; + Path path; try { - content = Files.readString(Paths.get(path)); + path = Paths.get(pathString); + content = new String(Files.readAllBytes(path)); deread = new JSONArray(content); } catch (Exception e) { System.out.println("Read from file failed with %s"); |