From 6b1cb98c6c5f28db77d0953fce96d74506f53be7 Mon Sep 17 00:00:00 2001 From: WindiStone Date: Thu, 19 Sep 2024 17:11:29 +0800 Subject: [PATCH] History: Change save method to include correct filepath --- src/main/java/windebot/History.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main/java/windebot/History.java b/src/main/java/windebot/History.java index e751886210..2c94f56dcd 100644 --- a/src/main/java/windebot/History.java +++ b/src/main/java/windebot/History.java @@ -22,8 +22,8 @@ public class History { private static final String WINDE_FILE = "./src/main/java/windebot/WindeTasks.txt"; private static final String WINDE_ALTERNATE_FILE = - "/Users/winston/Desktop/Code/CS2103/ip/src/main/java/windebot/Winde.java"; - private static final String WINDE_ANOTHER_FILE = "../src/main/java/windebot/Winde.java"; + "/Users/winston/Desktop/Code/CS2103/ip/src/main/java/windebot/WindeTasks.txt"; + private static final String WINDE_ANOTHER_FILE = "WindeTasks.txt"; private static String filePath; @@ -56,8 +56,6 @@ public static ArrayList load() { ArrayList taskList = new ArrayList(); try { if (!file.exists()) { - file.createNewFile(); - file.getParentFile().mkdirs(); file.createNewFile(); // file.exists(); } @@ -113,7 +111,7 @@ private static Task readLine(String line) { public static void save(ArrayList reminder) { try { - FileWriter fw = new FileWriter(WINDE_FILE); + FileWriter fw = new FileWriter(WINDE_ANOTHER_FILE); for (Task tasks : reminder) { fw.write(tasks.toString() + "\n"); }