Class PathUtils


  • public class PathUtils
    extends java.lang.Object
    Path related utilities
    • Constructor Summary

      Constructors 
      Constructor Description
      PathUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static java.lang.String getTopNamespace​(java.lang.String path)
      return the top namespace of a znode path
      static java.lang.String normalizeFileSystemPath​(java.lang.String path)
      Convert Windows path to Unix
      static void validatePath​(java.lang.String path)
      Validate the provided znode path string
      static void validatePath​(java.lang.String path, boolean isSequential)
      validate the provided znode path string
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • PathUtils

        public PathUtils()
    • Method Detail

      • validatePath

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

        public static void validatePath​(java.lang.String path)
                                 throws java.lang.IllegalArgumentException
        Validate the provided znode path string
        Parameters:
        path - znode path string
        Throws:
        java.lang.IllegalArgumentException - if the path is invalid
      • normalizeFileSystemPath

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

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