Skip to content

Commit bff7c5e

Browse files
committed
#18 added optional ordering on file resources collection
1 parent e3a3b46 commit bff7c5e

File tree

2 files changed

+17
-2
lines changed

2 files changed

+17
-2
lines changed

pom.xml

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
</parent>
99

1010
<artifactId>plexus-io</artifactId>
11-
<version>3.1.2-SNAPSHOT</version>
11+
<version>3.2.0-SNAPSHOT</version>
1212

1313
<name>Plexus IO Components</name>
1414

@@ -38,7 +38,7 @@
3838
<dependency>
3939
<groupId>org.codehaus.plexus</groupId>
4040
<artifactId>plexus-utils</artifactId>
41-
<version>3.1.0</version>
41+
<version>3.3.0-SNAPSHOT</version>
4242
</dependency>
4343
<dependency>
4444
<groupId>org.codehaus.plexus</groupId>

src/main/java/org/codehaus/plexus/components/io/resources/PlexusIoFileResourceCollection.java

+15
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
import java.io.IOException;
2929
import java.io.InputStream;
3030
import java.util.ArrayList;
31+
import java.util.Comparator;
3132
import java.util.HashMap;
3233
import java.util.Iterator;
3334
import java.util.List;
@@ -50,6 +51,11 @@ public class PlexusIoFileResourceCollection
5051

5152
private boolean isFollowingSymLinks = true;
5253

54+
/**
55+
* @since 3.2.0
56+
*/
57+
private Comparator<String> filenameComparator;
58+
5359
public PlexusIoFileResourceCollection()
5460
{
5561
}
@@ -241,6 +247,7 @@ public Iterator<PlexusIoResource> getResources()
241247
}
242248
ds.setCaseSensitive( isCaseSensitive() );
243249
ds.setFollowSymlinks( isFollowingSymLinks() );
250+
ds.setFilenameComparator( filenameComparator );
244251
ds.scan();
245252

246253
final List<PlexusIoResource> result = new ArrayList<>();
@@ -259,4 +266,12 @@ public boolean isConcurrentAccessSupported()
259266
{
260267
return true;
261268
}
269+
270+
/**
271+
* @since 3.2.0
272+
*/
273+
public void setFilenameComparator( Comparator<String> filenameComparator )
274+
{
275+
this.filenameComparator = filenameComparator;
276+
}
262277
}

0 commit comments

Comments
 (0)