Skip to content

Commit

Permalink
History: Edit the save file directory
Browse files Browse the repository at this point in the history
  • Loading branch information
WinstonJin committed Sep 18, 2024
1 parent 0b5eec4 commit 2e61f4c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
1 change: 0 additions & 1 deletion src/main/java/WindeTasks.txt
Original file line number Diff line number Diff line change
@@ -1 +0,0 @@
T | O | something
12 changes: 9 additions & 3 deletions src/main/java/windebot/History.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,10 @@
*/

public class History {
private static final String WINDE_FILE = "./src/main/java/WindeTasks.txt";
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";

private static String filePath;

/**
Expand All @@ -38,7 +41,7 @@ public class History {
*/

History() {
this.filePath = WINDE_FILE;
this.filePath = WINDE_ANOTHER_FILE;
}

/**
Expand All @@ -53,6 +56,9 @@ public static ArrayList<Task> load() {
try {
if (!file.exists()) {
file.createNewFile();
file.getParentFile().mkdirs();
file.createNewFile();
// file.exists();
}
} catch (IOException ioe) {
System.out.println("Error in creating file" + ioe.getMessage());
Expand All @@ -77,7 +83,7 @@ public static ArrayList<Task> load() {
* @return A task which the file line was coding for.
*/

public static Task readLine(String line) {
private static Task readLine(String line) {
String complete = "X";
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("dd/MM/yyyy HH:mm");
Task task;
Expand Down
1 change: 1 addition & 0 deletions src/main/java/windebot/WindeTasks.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
T | O | nothing

0 comments on commit 2e61f4c

Please sign in to comment.