Java 类org.apache.commons.io.comparator.PathFileComparator 实例源码
项目:greenpepper
文件:FileSystemRepository.java
private void navigateInto(File directory, Hashtable<String, Vector<?>> pageBranch) throws IOException {
File[] files = directory.listFiles(NOT_HIDDEN);
if (files != null) {
Arrays.sort(files, PathFileComparator.PATH_COMPARATOR);
for (File file : files) {
if (file.isDirectory() || isSupported(file)) {
generateDocumentNode(file, pageBranch);
}
}
}
}
项目:vso-intellij
文件:SystemHelper.java
/**
* Compares to file paths to see if they are the same based on the OS that is being used
*
* @param path1
* @param path2
* @return
*/
public static boolean areFilePathsSame(final String path1, final String path2) {
return PathFileComparator.PATH_SYSTEM_COMPARATOR.compare(new File(path1), new File(path2)) == 0 ? true : false;
}