-
Notifications
You must be signed in to change notification settings - Fork 49
Parameter fileMapper
for unpack path rewriting
#100
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
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 you also please provide some tests that verify that the mappers are working. I think it will also worth to have an test that verifies that when prefix file mapper is used with value such as ../
the extraction will fail and the destination directory is not escaped.
Tests whether rewritten path is outside of target dir by b575e28. |
@plamentotev All requested changes done. Review please. :-) |
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. Looks great. There are two small comments about the formatting, looks like I've missed them on the first review. If you have time would you please fix them and squash the commits into one and I'll merge it. Otherwise I can do it - it is not a problem.
src/main/java/org/codehaus/plexus/archiver/AbstractUnArchiver.java
Outdated
Show resolved
Hide resolved
src/main/java/org/codehaus/plexus/archiver/AbstractUnArchiver.java
Outdated
Show resolved
Hide resolved
The new parameter `fileMapper` (default: null) can be set to an implementation of the `org.codehaus.plexus.components.io.filemappers.FileMapper` interface to rewrite the target path of each unpacked file. This is useful in case prefixes of target files names within the target directory shall be added (using `PrefixFileMapper`), changed or omitted (using `RegExpFileMapper`). Signed-off-by: Markus KARG <[email protected]>
@plamentotev All requested changes done; all commits squashed into a single one. Merging requested. :-) |
The new parameter
fileMapper
(default:null
) can be set to an implementation of theorg.codehaus.plexus.components.io.filemappers.FileMapper
interface to rewrite the target path of each unpacked file.This is useful in case prefixes of target files names within the target directory shall be added (using
PrefixFileMapper
), changed or omitted (usingRegExpFileMapper
).PR #5 of Maven Dependency Plugin is dependent on this PR.