Package com.google.cloud.hadoop.gcsio
Class UriPaths
- java.lang.Object
-
- com.google.cloud.hadoop.gcsio.UriPaths
-
public final class UriPaths extends Object
Utility methods for URI GCS paths
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static URIfromResourceId(StorageResourceId resourceId, boolean allowEmptyObjectName)Constructs and returns full path for the given bucket and object names.static URIfromStringPathComponents(String bucketName, String objectName, boolean allowEmptyObjectName)Constructs and returns full path for the given bucket and object names.static URIgetParentPath(URI path)Gets the parent directory of the given path.static URItoDirectory(URI path)Converts the given path to look like a directory path.
-
-
-
Method Detail
-
toDirectory
public static URI toDirectory(URI path)
Converts the given path to look like a directory path. If the path already looks like a directory path then this call is a no-op.- Parameters:
path- Path to convert.- Returns:
- Directory path for the given path.
-
getParentPath
public static URI getParentPath(URI path)
Gets the parent directory of the given path.- Parameters:
path- Path to convert.- Returns:
- Path of parent directory of the given item or null for root path.
-
fromResourceId
public static URI fromResourceId(StorageResourceId resourceId, boolean allowEmptyObjectName)
Constructs and returns full path for the given bucket and object names.
-
-