Class PathUtils

java.lang.Object
org.openrewrite.PathUtils

public class PathUtils extends Object
  • Method Details

    • equalIgnoringSeparators

      public static boolean equalIgnoringSeparators(Path a, Path b)
      Compare two paths, returning true if they indicate the same path, regardless of separators. Does not account for comparison of a relative path to an absolute path, but within the context of OpenRewrite all paths should be relative anyway. "foo/a.txt" is considered to be equal to "foo\a.txt"
    • equalIgnoringSeparators

      public static boolean equalIgnoringSeparators(String a, String b)
      Compare two strings representing file paths, returning true if they indicate the same path regardless of separators
    • separatorsToUnix

      public static String separatorsToUnix(String path)
    • separatorsToWindows

      public static String separatorsToWindows(String path)
    • separatorsToSystem

      public static String separatorsToSystem(String path)
    • matchesGlob

      public static boolean matchesGlob(@Nullable Path path, @Nullable String globPattern)
    • convertNegationToWildcard

      public static String convertNegationToWildcard(String globPattern)
    • getExcludedPatterns

      public static List<String> getExcludedPatterns(String globPattern)
    • getEitherOrPatterns

      public static List<String> getEitherOrPatterns(String globPattern)