-
Notifications
You must be signed in to change notification settings - Fork 10
[MASSEMBLY-617] add ability to give a fileSuffix to a AbstractPlexusI… #7
base: master
Are you sure you want to change the base?
Conversation
…oResourceCollection
@@ -149,6 +149,8 @@ private void addResources( List<PlexusIoResource> result, String[] resources, | |||
for ( String name : resources ) | |||
{ | |||
String sourceDir = name.replace( '\\', '/' ); | |||
|
|||
name = addFileNameSuffix(name); |
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.
Add the whitespace please
@@ -185,6 +187,7 @@ private void addResourcesJava7( List<PlexusIoResource> result, String[] resource | |||
for ( String name : resources ) | |||
{ | |||
String sourceDir = name.replace( '\\', '/' ); | |||
name = addFileNameSuffix(name); |
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.
same here
private String addFileNameSuffix(String name) | ||
{ | ||
String nameWithSuffix = name; | ||
if (getFileSuffix() != null && getFileSuffix() != "") |
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 StringUtils
from Plexus Utils here.
{ | ||
String[] split = name.split("\\."); | ||
String extension = "." + split[split.length-1]; | ||
nameWithSuffix = name.replace(extension, getFileSuffix() + extension); |
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 block is not reliable. What about tar.gz
or similar?
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.
You're right, I'll fix this, but I must write a rule, I add javadoc explanation
And I have swtich the PR here : codehaus-plexus/plexus-io#13 |
…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