Package org.apache.zookeeper.common
Class PathUtils
java.lang.Object
org.apache.zookeeper.common.PathUtils
Path related utilities
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
getTopNamespace
(String path) return the top namespace of a znode pathstatic String
Convert Windows path to Unixstatic void
validatePath
(String path) Validate the provided znode path stringstatic void
validatePath
(String path, boolean isSequential) validate the provided znode path string
-
Constructor Details
-
PathUtils
public PathUtils()
-
-
Method Details
-
validatePath
validate the provided znode path string- Parameters:
path
- znode path stringisSequential
- if the path is being created with a sequential flag- Throws:
IllegalArgumentException
- if the path is invalid
-
validatePath
Validate the provided znode path string- Parameters:
path
- znode path string- Throws:
IllegalArgumentException
- if the path is invalid
-
normalizeFileSystemPath
Convert Windows path to Unix- Parameters:
path
- file path- Returns:
- converted file path
-
getTopNamespace
return the top namespace of a znode path- Parameters:
path
- znode path string- Returns:
- the top namespace. If not exist, return null
-