java.lang.Object
com.pervasive.datarush.hadoop.io.PathUtility
Utility methods for dealing with Hadoop style paths.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic StringConvert a URL style path into it's normalized form.static StringfileSystemPath(String path) Convert a full URL style path in the root file system path.static StringGet the last file segment of the given path.static StringGet the parent directory of the given path.static StringResolve the given path and the path segment to be appended.
-
Constructor Details
-
PathUtility
public PathUtility()
-
-
Method Details
-
fileSystemPath
Convert a full URL style path in the root file system path.- Parameters:
path- HDFS style path- Returns:
- root filesystem path
-
filePath
Convert a URL style path into it's normalized form. This ensures the format fits a stricter URL form, i.e. hdfs://<host:port>/path.- Parameters:
path- HDFS style path- Returns:
- normalized path
-
getParent
Get the parent directory of the given path.- Parameters:
path- Hadoop style path- Returns:
- given path minus the lowest file segment
-
resolve
Resolve the given path and the path segment to be appended. Returns the given path plus the path segment merged together to resolve issues with the base path and path separators.- Parameters:
path- input (base) pathother- a path segment to append- Returns:
- the resolved path
-
getName
Get the last file segment of the given path.- Parameters:
path- full URL style path- Returns:
- the last file segment (or "/" if already root)
-