Skip to content

Commit

Permalink
Merge pull request #92 from ZhouJunmin/Branch_v2.0_Release
Browse files Browse the repository at this point in the history
Update Storage Class to include data files in Jar file build.
  • Loading branch information
ZhouJunmin authored Apr 2, 2024
2 parents 4222e15 + 415ed1c commit da50a73
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/main/java/seedu/planus/Storage.java
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,17 @@ private static Course parseCourse(String timetableName, String sentence) throws
public static String searchCourse(String courseCode, Integer MCs) {
String courseName;
File f = new File(COURSE_LIST_PATH);
if (!f.exists()) {
InputStream in = Thread.currentThread().getContextClassLoader()
.getResourceAsStream("CourseList.csv");
try {
Path filePath = Paths.get("./data/CourseList.csv");
Files.copy(in, filePath, StandardCopyOption.REPLACE_EXISTING);
assert in != null : "The input stream is null.";
} catch (IOException e) {
throw new RuntimeException(e);
}
}

Scanner s = null;
try {
Expand Down

0 comments on commit da50a73

Please sign in to comment.