Skip to content

Commit

Permalink
#18 added optional ordering on file resources collection
Browse files Browse the repository at this point in the history
  • Loading branch information
hboutemy committed Aug 25, 2019
1 parent e3a3b46 commit bff7c5e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
</parent>

<artifactId>plexus-io</artifactId>
<version>3.1.2-SNAPSHOT</version>
<version>3.2.0-SNAPSHOT</version>

<name>Plexus IO Components</name>

Expand Down Expand Up @@ -38,7 +38,7 @@
<dependency>
<groupId>org.codehaus.plexus</groupId>
<artifactId>plexus-utils</artifactId>
<version>3.1.0</version>
<version>3.3.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.codehaus.plexus</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import java.io.IOException;
import java.io.InputStream;
import java.util.ArrayList;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
Expand All @@ -50,6 +51,11 @@ public class PlexusIoFileResourceCollection

private boolean isFollowingSymLinks = true;

/**
* @since 3.2.0
*/
private Comparator<String> filenameComparator;

public PlexusIoFileResourceCollection()
{
}
Expand Down Expand Up @@ -241,6 +247,7 @@ public Iterator<PlexusIoResource> getResources()
}
ds.setCaseSensitive( isCaseSensitive() );
ds.setFollowSymlinks( isFollowingSymLinks() );
ds.setFilenameComparator( filenameComparator );
ds.scan();

final List<PlexusIoResource> result = new ArrayList<>();
Expand All @@ -259,4 +266,12 @@ public boolean isConcurrentAccessSupported()
{
return true;
}

/**
* @since 3.2.0
*/
public void setFilenameComparator( Comparator<String> filenameComparator )
{
this.filenameComparator = filenameComparator;
}
}

0 comments on commit bff7c5e

Please sign in to comment.