Skip to content
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

Improve StudentFileAwareZipper #76

Merged
merged 5 commits into from
Jan 4, 2017

Conversation

cxcorp
Copy link
Contributor

@cxcorp cxcorp commented Dec 22, 2016

Closes #75

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 73.813% when pulling a508667 on cxcorp:zipper-path-separators into fce2329 on testmycode:master.

2 similar comments
@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 73.813% when pulling a508667 on cxcorp:zipper-path-separators into fce2329 on testmycode:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 73.813% when pulling a508667 on cxcorp:zipper-path-separators into fce2329 on testmycode:master.

@@ -110,10 +111,13 @@ private void writeToZip(Path currentPath, ZipArchiveOutputStream zipStream, Path
log.trace("Writing {} to zip", currentPath);

String name = projectPath.getParent().relativize(currentPath).toString();
// zip standard says "/" is to be used as the path separator
name = FilenameUtils.separatorsToUnix(name);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Unix-based systems it is legal to have \-characters in the filename. We don't want to accidentally interpret those as path separators. That's why I would prefer the implementation I proposed earlier.

@cxcorp cxcorp force-pushed the zipper-path-separators branch 3 times, most recently from ee75d66 to a455afc Compare January 3, 2017 17:19
@coveralls
Copy link

coveralls commented Jan 3, 2017

Coverage Status

Coverage increased (+0.01%) to 73.813% when pulling a455afc on cxcorp:zipper-path-separators into fce2329 on testmycode:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+0.01%) to 73.813% when pulling a455afc on cxcorp:zipper-path-separators into fce2329 on testmycode:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.07%) to 73.869% when pulling a455afc on cxcorp:zipper-path-separators into fce2329 on testmycode:master.

2 similar comments
@coveralls
Copy link

Coverage Status

Coverage increased (+0.07%) to 73.869% when pulling a455afc on cxcorp:zipper-path-separators into fce2329 on testmycode:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.07%) to 73.869% when pulling a455afc on cxcorp:zipper-path-separators into fce2329 on testmycode:master.

Copy link
Member

@nygrenh nygrenh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One nitpick, otherwise looks good :)

log.trace("Generating zip-compliant filename from Path \"{}\", isDirectory: {}",
path, isDirectory);
// zip standard says "/" is to be used as the path separator.
final char separator = '/';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you move this out of the method and make it private static final char ZIP_SEPARATOR = '/'?

The StudentFileAwareZipper includes the provided root directory in the zip
archive as a parent directory. File system roots aren't named directories,
so they cannot be added as such.
@coveralls
Copy link

Coverage Status

Coverage increased (+0.07%) to 73.869% when pulling a455afc on cxcorp:zipper-path-separators into fce2329 on testmycode:master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+0.07%) to 73.869% when pulling a455afc on cxcorp:zipper-path-separators into fce2329 on testmycode:master.

@cxcorp cxcorp changed the title Have zipper use standard-compliant path separators Improve StudentFileAwareZipper Jan 3, 2017
@coveralls
Copy link

Coverage Status

Coverage increased (+0.06%) to 73.856% when pulling 1b2b5d2 on cxcorp:zipper-path-separators into fce2329 on testmycode:master.

2 similar comments
@coveralls
Copy link

Coverage Status

Coverage increased (+0.06%) to 73.856% when pulling 1b2b5d2 on cxcorp:zipper-path-separators into fce2329 on testmycode:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.06%) to 73.856% when pulling 1b2b5d2 on cxcorp:zipper-path-separators into fce2329 on testmycode:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 74.137% when pulling 7998eb0 on cxcorp:zipper-path-separators into fce2329 on testmycode:master.

2 similar comments
@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 74.137% when pulling 7998eb0 on cxcorp:zipper-path-separators into fce2329 on testmycode:master.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.3%) to 74.137% when pulling 7998eb0 on cxcorp:zipper-path-separators into fce2329 on testmycode:master.

@nygrenh nygrenh merged commit 4d01f36 into testmycode:master Jan 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants