Skip to content

Commit

Permalink
method for testpath
Browse files Browse the repository at this point in the history
  • Loading branch information
Aqua-sc committed Mar 8, 2024
1 parent d521620 commit 7659d16
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@ static public Path getSubmissionPath(long projectid, long groupid, long submissi
return Path.of(BASEPATH,"projects", String.valueOf(projectid), String.valueOf(groupid), String.valueOf(submissionid));
}

static public Path getTestPath(long projectid) {
return Path.of(BASEPATH,"projects", String.valueOf(projectid), "tests");
}

public static boolean isZipFile(File file) throws IOException {
// Create a Tika instance
Tika tika = new Tika();
Expand All @@ -86,7 +90,7 @@ public static Path saveTest(MultipartFile file, long projectId) throws IOExcepti
}

// Create directory if it doesn't exist
Path projectDirectory = Paths.get("/data/projects/" + projectId + "/tests/");
Path projectDirectory = getTestPath(projectId);
if (!Files.exists(projectDirectory)) {
Files.createDirectories(projectDirectory);
}
Expand Down

0 comments on commit 7659d16

Please sign in to comment.