From 402b25d25e91048e284513c19300cdad42054ff8 Mon Sep 17 00:00:00 2001 From: j-james Date: Fri, 28 Oct 2022 21:43:06 -0700 Subject: WHY is the autobot still on Java 8 --- src/main/persistance/JsonUtils.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src') 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"); -- cgit v1.2.3-70-g09d2