@Test public void testCaseSensitivity() { final File file3 = new File("a/FOO.txt"); final Comparator<File> sensitive = new NameFileComparator(null); assertTrue("sensitive file1 & file2 = 0", sensitive.compare(equalFile1, equalFile2) == 0); assertTrue("sensitive file1 & file3 > 0", sensitive.compare(equalFile1, file3) > 0); assertTrue("sensitive file1 & less > 0", sensitive.compare(equalFile1, lessFile) > 0); final Comparator<File> insensitive = NameFileComparator.NAME_INSENSITIVE_COMPARATOR; assertTrue("insensitive file1 & file2 = 0", insensitive.compare(equalFile1, equalFile2) == 0); assertTrue("insensitive file1 & file3 = 0", insensitive.compare(equalFile1, file3) == 0); assertTrue("insensitive file1 & file4 > 0", insensitive.compare(equalFile1, lessFile) > 0); assertTrue("insensitive file3 & less > 0", insensitive.compare(file3, lessFile) > 0); }
public int compare(final File file1, final File file2) { return caseSensitivity.checkCompareTo(file1.getName(), file2.getName()); }
NameFileComparator extends AbstractFileComparator implements Serializable { public int compare(final File file1, final File file2) { return caseSensitivity.checkCompareTo(file1.getName(), file2.getName()); } }
NameFileComparator extends AbstractFileComparator implements Serializable { public int compare(final File file1, final File file2) { return caseSensitivity.checkCompareTo(file1.getName(), file2.getName()); } NameFileComparator();  NameFileComparator(final IOCase caseSensitivity); }
NameFileComparator extends AbstractFileComparator implements Serializable { public int compare(final File file1, final File file2) { return caseSensitivity.checkCompareTo(file1.getName(), file2.getName()); } NameFileComparator();  NameFileComparator(final IOCase caseSensitivity); int compare(final File file1, final File file2); @Override String toString(); }
NameFileComparator extends AbstractFileComparator implements Serializable { public int compare(final File file1, final File file2) { return caseSensitivity.checkCompareTo(file1.getName(), file2.getName()); } NameFileComparator();  NameFileComparator(final IOCase caseSensitivity); int compare(final File file1, final File file2); @Override String toString(); static final Comparator<File> NAME_COMPARATOR; static final Comparator<File> NAME_REVERSE; static final Comparator<File> NAME_INSENSITIVE_COMPARATOR; static final Comparator<File> NAME_INSENSITIVE_REVERSE; static final Comparator<File> NAME_SYSTEM_COMPARATOR; static final Comparator<File> NAME_SYSTEM_REVERSE; }