diff --git a/core/src/main/java/de/jplag/reporting/FilePathUtil.java b/core/src/main/java/de/jplag/reporting/FilePathUtil.java index 51aefdd36..aff67ef3e 100644 --- a/core/src/main/java/de/jplag/reporting/FilePathUtil.java +++ b/core/src/main/java/de/jplag/reporting/FilePathUtil.java @@ -8,6 +8,7 @@ public final class FilePathUtil { private static final String ZIP_PATH_SEPARATOR = "/"; // Paths in zip files are always separated by a slash + private static final String WINDOWS_PATH_SEPARATOR = "\\"; private FilePathUtil() { // private constructor to prevent instantiation @@ -35,12 +36,12 @@ public static String getRelativeSubmissionPath(File file, Submission submission, */ public static String joinZipPathSegments(String left, String right) { String rightStripped = right; - while (rightStripped.startsWith(ZIP_PATH_SEPARATOR)) { + while (rightStripped.startsWith(ZIP_PATH_SEPARATOR) || rightStripped.startsWith(WINDOWS_PATH_SEPARATOR)) { rightStripped = rightStripped.substring(1); } String leftStripped = left; - while (leftStripped.endsWith(ZIP_PATH_SEPARATOR)) { + while (leftStripped.endsWith(ZIP_PATH_SEPARATOR) || leftStripped.startsWith(WINDOWS_PATH_SEPARATOR)) { leftStripped = leftStripped.substring(0, leftStripped.length() - 1); }