Skip to content
Snippets Groups Projects
Commit fbc5b972 authored by Emmanuel Bourg's avatar Emmanuel Bourg
Browse files

New upstream version 3.3.0

parent 553fd973
No related branches found
No related tags found
No related merge requests found
......@@ -5,6 +5,8 @@ jdk:
- openjdk11
# - openjdk12 add once code is requires Java 7
dist: trusty
# No need for preliminary install step.
install: true
#
......
......@@ -26,7 +26,7 @@ limitations under the License.
</parent>
<artifactId>plexus-utils</artifactId>
<version>3.2.1</version>
<version>3.3.0</version>
<name>Plexus Common Utilities</name>
<description>A collection of various utility classes to ease working with strings, files, command lines, XML and
......@@ -37,7 +37,7 @@ limitations under the License.
<connection>scm:git:git@github.com:codehaus-plexus/plexus-utils.git</connection>
<developerConnection>scm:git:git@github.com:codehaus-plexus/plexus-utils.git</developerConnection>
<url>http://github.com/codehaus-plexus/plexus-utils</url>
<tag>plexus-utils-3.2.1</tag>
<tag>plexus-utils-3.3.0</tag>
</scm>
<issueManagement>
<system>github</system>
......
......@@ -18,6 +18,7 @@
import java.io.File;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.List;
/**
......@@ -119,6 +120,11 @@ public abstract class AbstractScanner
*/
protected boolean isCaseSensitive = true;
/**
* @since 3.3.0
*/
protected Comparator<String> filenameComparator;
/**
* Sets whether or not the file system should be regarded as case sensitive.
*
......@@ -390,4 +396,10 @@ protected void setupMatchPatterns()
includesPatterns = MatchPatterns.from( includes );
excludesPatterns = MatchPatterns.from( excludes );
}
@Override
public void setFilenameComparator( Comparator<String> filenameComparator )
{
this.filenameComparator = filenameComparator;
}
}
......@@ -57,6 +57,7 @@
import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Vector;
/**
......@@ -436,6 +437,11 @@ protected void scandir( File dir, String vpath, boolean fast )
newfiles = noLinks.toArray( new String[noLinks.size()] );
}
if ( filenameComparator != null )
{
Arrays.sort( newfiles, filenameComparator );
}
for ( String newfile : newfiles )
{
String name = vpath + newfile;
......
......@@ -17,6 +17,7 @@
*/
import java.io.File;
import java.util.Comparator;
/**
* Scan a directory tree for files, with specified inclusions and exclusions.
......@@ -83,4 +84,12 @@ public interface Scanner
* @return the base directory to be scanned
*/
File getBasedir();
/**
* Use a filename comparator in each directory when scanning.
*
* @param filenameComparator
* @since 3.3.0
*/
void setFilenameComparator( Comparator<String> filenameComparator );
}
......@@ -488,6 +488,15 @@ public String[] getCommandline()
return getShellCommandline();
}
return getRawCommandline();
}
/**
* Returns the executable and all defined arguments.<br>
*
*/
public String[] getRawCommandline()
{
final String[] args = getArguments();
String executable = getLiteralExecutable();
......@@ -501,7 +510,7 @@ public String[] getCommandline()
return result;
}
/**
/**
* Returns the shell, executable and all defined arguments. Shell usage is only desirable when generating code for
* remote execution.
*/
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment