Skip to content

Commit

Permalink
Update reference for file handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Zhilin-Huang committed Feb 17, 2020
1 parent 3d3519d commit 8cbfcf0
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/main/java/chatty/ChattyChatBot.java
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,8 @@ private static void readDataFromFile(List<Task> tasks) {
File file = new File(System.getProperty("user.dir"), filePath);
System.out.println("Reading tasks from disk...");
try {
// Solution below adapted from: https://stackoverflow
// .com/questions/6142901/how-to-create-a-file-in-a-directory-in-java
file.getParentFile().mkdirs();
if (file.createNewFile()) {
System.out.println("New output file created");
Expand Down

0 comments on commit 8cbfcf0

Please sign in to comment.