Closed cxcorp closed 7 years ago
Probable culprit: https://github.com/testmycode/tmc-langs/blob/master/tmc-langs-framework/src/main/java/fi/helsinki/cs/tmc/langs/io/zip/StudentFileAwareZipper.java#L112
String name = projectPath.getParent().relativize(currentPath).toString();
if (Files.isDirectory(currentPath)) {
log.trace("{} is a directory", currentPath);
// Must be "/", can not be replaces with File.separator
name += "/";
}
I'm guessing Path.toString
outputs platform-specific slashes.
On Windows,
zipperDetectectsAndObeysTmcnosubmitFiles
andzipperCorrectlyZipsFolderWithFilesAndSubFolders
fromfi.helsinki.cs.tmc.langs.io.zip.StudentFileAwareZipperTest
fail because some of the zip entry names have their forward slashes turned into backslashes. For example,tmcnosubmit_test_case/allowed/
gets changed intotmcnosubmit_test_case\allowed/
.Honestly though, I don't quite understand why the zip files' entries are checked via a hashmap
.Contains(filename)
-kind of check. Wouldn't ZipFile.equals work?