Skip to content

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

Merged
merged 3 commits into from
Feb 25, 2017
Merged

Not ignore fullpath on tarfileset #254

merged 3 commits into from
Feb 25, 2017

Conversation

dirb
Copy link
Contributor

@dirb dirb commented Feb 25, 2017

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.

@coveralls
Copy link

coveralls commented Feb 25, 2017

Coverage Status

Coverage remained the same at 75.442% when pulling c341ed4 on dirb:fix-245 into 0225723 on tcurdt:master.

@tcurdt
Copy link
Owner

tcurdt commented Feb 25, 2017

Really not a big ant user. Thanks for the PR!

Copy link
Owner

@tcurdt tcurdt left a 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 = "";
}
Copy link
Owner

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);
Copy link
Owner

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;

@tcurdt tcurdt self-assigned this Feb 25, 2017
@tcurdt tcurdt added this to the 1.6 milestone Feb 25, 2017
@tcurdt tcurdt added bug and removed improvement labels Feb 25, 2017
@codecov-io
Copy link

Codecov Report

Merging #254 into master will not change coverage.
The diff coverage is n/a.

@@            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.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0225723...656c772. Read the comment docs.

Copy link
Owner

@tcurdt tcurdt left a comment

Choose a reason for hiding this comment

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

Thanks, looking good.

@tcurdt tcurdt merged commit 110fe8f into tcurdt:master Feb 25, 2017
@coveralls
Copy link

coveralls commented Feb 25, 2017

Coverage Status

Coverage remained the same at 75.442% when pulling 656c772 on dirb:fix-245 into 0225723 on tcurdt:master.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[ant] tarfileset fullpath is ignored
4 participants