Skip to content
Commits on Source (4)
......@@ -5,6 +5,8 @@ jdk:
- openjdk11
# - openjdk12 add once code is requires Java 7
dist: trusty
# No need for preliminary install step.
install: true
#
......
plexus-utils2 (3.3.0-1) unstable; urgency=medium
* Team upload.
* New upstream release
* Standards-Version updated to 4.5.0
-- Emmanuel Bourg <ebourg@apache.org> Mon, 27 Jan 2020 17:17:00 +0100
plexus-utils2 (3.2.1-1) unstable; urgency=medium
* Team upload.
......
......@@ -11,7 +11,7 @@ Build-Depends:
libmaven-javadoc-plugin-java,
libmaven-plugin-testing-java,
maven-debian-helper
Standards-Version: 4.4.0
Standards-Version: 4.5.0
Vcs-Git: https://salsa.debian.org/java-team/plexus-utils2.git
Vcs-Browser: https://salsa.debian.org/java-team/plexus-utils2
Homepage: http://codehaus-plexus.github.io/plexus-utils/
......
......@@ -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();
......