Class PathUtils


  • public class PathUtils
    extends Object
    Path related utilities
    • Constructor Detail

      • PathUtils

        public PathUtils()
    • Method Detail

      • validatePath

        public static void validatePath​(String path,
                                        boolean isSequential)
                                 throws IllegalArgumentException
        validate the provided znode path string
        Parameters:
        path - znode path string
        isSequential - if the path is being created with a sequential flag
        Throws:
        IllegalArgumentException - if the path is invalid
      • normalizeFileSystemPath

        public static String normalizeFileSystemPath​(String path)
        Convert Windows path to Unix
        Parameters:
        path - file path
        Returns:
        converted file path
      • getTopNamespace

        public static String getTopNamespace​(String path)
        return the top namespace of a znode path
        Parameters:
        path - znode path string
        Returns:
        the top namespace. If not exist, return null