-
Notifications
You must be signed in to change notification settings - Fork 314
Not ignore fullpath on tarfileset #254
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
Conversation
Really not a big ant user. Thanks for the PR! |
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.
Would be great if you could change the one line and add explain the special single file handling a bit better in the comment. Thanks!
if (scanner.getIncludedFilesCount() != 1 || scanner.getIncludedDirsCount() != 0) { | ||
//this isn't a single-file tarfileset, ignoring the fullpath | ||
fullpath = ""; | ||
} |
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.
This isn't obvious to me. The fullpath can only be set on single-file sets?
@@ -86,7 +93,7 @@ public void produce( final DataConsumer pReceiver ) throws IOException { | |||
|
|||
final InputStream inputStream = new FileInputStream(file); | |||
try { | |||
final String entryName = prefix + "/" + name; | |||
final String entryName = (fullpath.equals("") ? prefix + "/" + name : fullpath); |
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.
Please use:
final String entryName = "".equals(fullpath) ? prefix + "/" + name : fullpath;
Codecov Report
@@ Coverage Diff @@
## master #254 +/- ##
=========================================
Coverage 67.13% 67.13%
- Complexity 0 85 +85
=========================================
Files 7 7
Lines 566 566
Branches 85 74 -11
=========================================
Hits 380 380
Misses 139 139
Partials 47 47 Continue to review full report at Codecov.
|
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.
Thanks, looking good.
This PR is trying to resolve #245, this take the fullpath attribute from the tarfileset and use it to define the entryName of the file, but only if the tarfileset is a single-file fileset.