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

Parameter fileMapper for unpack path rewriting #100

Closed
wants to merge 1 commit into from

Conversation

mkarg
Copy link

@mkarg mkarg commented Sep 19, 2018

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

PR #5 of Maven Dependency Plugin is dependent on this PR.

Copy link
Member

@plamentotev plamentotev left a 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.

@mkarg
Copy link
Author

mkarg commented Sep 24, 2018

Tests whether rewritten path is outside of target dir by b575e28.

@mkarg
Copy link
Author

mkarg commented Sep 24, 2018

@plamentotev All requested changes done. Review please. :-)

Copy link
Member

@plamentotev plamentotev left a 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.

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]>
@mkarg
Copy link
Author

mkarg commented Sep 25, 2018

@plamentotev All requested changes done; all commits squashed into a single one. Merging requested. :-)

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

Successfully merging this pull request may close these issues.

3 participants