Skip to content
This repository was archived by the owner on Aug 11, 2020. It is now read-only.

Conversation

tcollignon
Copy link

…oResourceCollection

Hi

In order to fix https://issues.apache.org/jira/browse/MASSEMBLY-617, I need to add a capability to PlexusIoFileResourceCollection, to add file suffix when it package files.
This PR add this feature.

Tell me if something goes wrong

Thx

{
String sourceDir = name.replace( '\\', '/' );

name = addFileNameSuffix(name);

Choose a reason for hiding this comment

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

Add the whitespace please

for ( String name : resources )
{
String sourceDir = name.replace( '\\', '/' );
name = addFileNameSuffix(name);

Choose a reason for hiding this comment

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

same here

private String addFileNameSuffix(String name)
{
String nameWithSuffix = name;
if (getFileSuffix() != null && getFileSuffix() != "")

Choose a reason for hiding this comment

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

Please use StringUtils from Plexus Utils here.

{
String[] split = name.split("\\.");
String extension = "." + split[split.length-1];
nameWithSuffix = name.replace(extension, getFileSuffix() + extension);

Choose a reason for hiding this comment

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

This block is not reliable. What about tar.gz or similar?

Copy link
Author

@tcollignon tcollignon Jun 21, 2018

Choose a reason for hiding this comment

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

You're right, I'll fix this, but I must write a rule, I add javadoc explanation

@tcollignon
Copy link
Author

And I have swtich the PR here : codehaus-plexus/plexus-io#13

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants