Example usage for org.apache.commons.io.comparator PathFileComparator PATH_SYSTEM_COMPARATOR

List of usage examples for org.apache.commons.io.comparator PathFileComparator PATH_SYSTEM_COMPARATOR

Introduction

In this page you can find the example usage for org.apache.commons.io.comparator PathFileComparator PATH_SYSTEM_COMPARATOR.

Prototype

Comparator PATH_SYSTEM_COMPARATOR

To view the source code for org.apache.commons.io.comparator PathFileComparator PATH_SYSTEM_COMPARATOR.

Click Source Link

Document

System sensitive path comparator instance (see IOCase#SYSTEM )

Usage

From source file:com.microsoft.alm.common.utils.SystemHelper.java

/**
 * Compares to file paths to see if they are the same based on the OS that is being used
 *
 * @param path1/*w w  w . j  a va  2 s  .  c om*/
 * @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;
}