diff options
author | Zach Jordan <zxjordan5@gmail.com> | 2023-05-30 20:45:47 -0400 |
---|---|---|
committer | Zach Jordan <zxjordan5@gmail.com> | 2023-05-30 20:45:47 -0400 |
commit | a671ee0633107290066e0cd4e706b7d00de868f2 (patch) | |
tree | 3ddb310daf005434f165761f55bb7b6959277110 /src/main/Difficulty.java | |
parent | 667a1e7e1f6bf030ac9ad0b80c43c2b560446e6b (diff) | |
download | NPEhero-a671ee0633107290066e0cd4e706b7d00de868f2.tar.gz NPEhero-a671ee0633107290066e0cd4e706b7d00de868f2.tar.bz2 NPEhero-a671ee0633107290066e0cd4e706b7d00de868f2.zip |
more testing
Diffstat (limited to '')
-rw-r--r-- | src/main/Difficulty.java | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/main/Difficulty.java b/src/main/Difficulty.java index e1d8d7e..02b3797 100644 --- a/src/main/Difficulty.java +++ b/src/main/Difficulty.java @@ -1,5 +1,6 @@ package main; +import java.io.BufferedReader; import java.io.File; import java.io.FileNotFoundException; import java.io.FileReader; @@ -31,10 +32,17 @@ public class Difficulty private String filepath; - public void parseMetadata(File file) + public void parseMetadata(File file) throws FileNotFoundException, IOException { JSONParser jsonParser = new JSONParser(); //parser to read the file + System.out.println("test"); + try (BufferedReader br = new BufferedReader(new FileReader(file))) { + String line; + while ((line = br.readLine()) != null) { + System.out.println(line); + } + } try(FileReader reader = new FileReader(file)) { Object obj = jsonParser.parse(reader); @@ -59,15 +67,14 @@ public class Difficulty } - public void parseLeaderboard(File file) { + public void parseLeaderboard(File file) throws FileNotFoundException, IOException { //and here //leaderboard.add(new LeaderboardEntry("placeholderScore", 0, "0/0/0")); JSONParser jsonParser = new JSONParser(); //parser to read the file - filepath = file.getName(); + filepath = file.getPath(); - System.out.println(file); try(FileReader reader = new FileReader(file)) { |