Package org.apache.zookeeper.common
Class PathUtils
- java.lang.Object
-
- org.apache.zookeeper.common.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 pathstatic java.lang.String
normalizeFileSystemPath(java.lang.String path)
Convert Windows path to Unixstatic void
validatePath(java.lang.String path)
Validate the provided znode path stringstatic void
validatePath(java.lang.String path, boolean isSequential)
validate the provided znode path string
-
-
-
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 stringisSequential
- 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
-
-