-
Notifications
You must be signed in to change notification settings - Fork 332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
FilePathUtils.joinZipPathSegments error on windows #1609
Conversation
… working with paths.
This does not generate the expected report with the single submission files, so just a folder with files.
We would expect the report zip be look like this:
But the zip looks like this:
|
I think this is again an issue with submissions without sub-directories. I will look into it tomorrow. |
I would suggest moving this to a diferent PR, since it is very independent of the other issue We should also disguss how we want the file names to actually look like |
I agree, but since the solutions depend on one another I would only create the second PR after this one has been merged. |
…es." This reverts commit 645110c.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Except for some JDoc this looks good.
Tested on windows
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just three minor things to discuss.
rightStripped = rightStripped.substring(1); | ||
public static Path forceRelativePath(Path path) { | ||
if (path.isAbsolute()) { | ||
return Path.of("/").relativize(path); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the explicit backslash intentional? Is it another concept or why is the constant with the same value not used?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The slash here is intentional, as we simply need a path that represents a root. It does not matter which, but in my opinion a UNIX root is the simplest. It does not use the constant, because the divider for zip paths is something else than a root. If you prefer it, I can change it to use the constant or a new one instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested on windows. Works with:
- Single Submission Folder
- Multiple Submission Folders
- Single Folder of Submission Foles
- Multiple Folders of submission files (appart from [bug] File structure discrepancy #1610
Quality Gate passed for 'JPlag Plagiarism Detector'Issues Measures |
The file creation now uses the path api instead of manual concatenation. I cannot test it on windows. So it would be great if someone could confirm it also works on windows.
Fixes #1592