Java Code Examples for org.apache.commons.io.comparator.NameFileComparator#NAME_SYSTEM_COMPARATOR
The following examples show how to use
org.apache.commons.io.comparator.NameFileComparator#NAME_SYSTEM_COMPARATOR .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FileAlterationObserver.java From aion-germany with GNU General Public License v3.0 | 6 votes |
/** * Construct an observer for the specified directory, file filter and * file comparator. * * @param rootEntry the root directory to observe * @param fileFilter The file filter or null if none * @param caseSensitivity what case sensitivity to use comparing file names, null means system sensitive */ protected FileAlterationObserver(FileEntry rootEntry, FileFilter fileFilter, IOCase caseSensitivity) { if (rootEntry == null) { throw new IllegalArgumentException("Root entry is missing"); } if (rootEntry.getFile() == null) { throw new IllegalArgumentException("Root directory is missing"); } this.rootEntry = rootEntry; this.fileFilter = fileFilter; if (caseSensitivity == null || caseSensitivity.equals(IOCase.SYSTEM)) { this.comparator = NameFileComparator.NAME_SYSTEM_COMPARATOR; } else if (caseSensitivity.equals(IOCase.INSENSITIVE)) { this.comparator = NameFileComparator.NAME_INSENSITIVE_COMPARATOR; } else { this.comparator = NameFileComparator.NAME_COMPARATOR; } }
Example 2
Source File: FileAlterationObserver.java From lams with GNU General Public License v2.0 | 6 votes |
/** * Construct an observer for the specified directory, file filter and * file comparator. * * @param rootEntry the root directory to observe * @param fileFilter The file filter or null if none * @param caseSensitivity what case sensitivity to use comparing file names, null means system sensitive */ protected FileAlterationObserver(final FileEntry rootEntry, final FileFilter fileFilter, final IOCase caseSensitivity) { if (rootEntry == null) { throw new IllegalArgumentException("Root entry is missing"); } if (rootEntry.getFile() == null) { throw new IllegalArgumentException("Root directory is missing"); } this.rootEntry = rootEntry; this.fileFilter = fileFilter; if (caseSensitivity == null || caseSensitivity.equals(IOCase.SYSTEM)) { this.comparator = NameFileComparator.NAME_SYSTEM_COMPARATOR; } else if (caseSensitivity.equals(IOCase.INSENSITIVE)) { this.comparator = NameFileComparator.NAME_INSENSITIVE_COMPARATOR; } else { this.comparator = NameFileComparator.NAME_COMPARATOR; } }
Example 3
Source File: AbstractIteratorMojo.java From iterator-maven-plugin with Apache License 2.0 | 6 votes |
protected Comparator<File> convertSortOrder() { Comparator<File> result = NameFileComparator.NAME_COMPARATOR; if ( getSortOrder().equalsIgnoreCase( "NAME_INSENSITIVE_COMPARATOR" ) ) { result = NameFileComparator.NAME_INSENSITIVE_COMPARATOR; } else if ( getSortOrder().equalsIgnoreCase( "NAME_INSENSITIVE_REVERSE" ) ) { result = NameFileComparator.NAME_INSENSITIVE_REVERSE; } else if ( getSortOrder().equalsIgnoreCase( "NAME_REVERSE" ) ) { result = NameFileComparator.NAME_REVERSE; } else if ( getSortOrder().equalsIgnoreCase( "NAME_SYSTEM_COMPARATOR" ) ) { result = NameFileComparator.NAME_SYSTEM_COMPARATOR; } else if ( getSortOrder().equalsIgnoreCase( "NAME_SYSTEM_REVERSE" ) ) { result = NameFileComparator.NAME_SYSTEM_REVERSE; } return result; }