public final class GridGgfsPath extends Object implements Comparable<GridGgfsPath>, Externalizable
GGFS path to file in the file system. For example, to get information about
a file you would use the following code:
GridGgfsPath dirPath = new GridGgfsPath("/my/working/dir");
GridGgfsPath filePath = new GridGgfsPath(dirPath, "file.txt");
// Get metadata about file.
GridGgfsFile file = ggfs.info(filePath);
| Constructor and Description |
|---|
GridGgfsPath()
Constructs default root path.
|
GridGgfsPath(GridGgfsPath parentPath,
String childPath)
Resolve a child path against a parent path.
|
GridGgfsPath(String path)
Constructs a path from the URI string.
|
GridGgfsPath(URI uri)
Constructs a path from an URI
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(GridGgfsPath o) |
List<String> |
components()
Split full path on components.
|
int |
depth()
Return the number of elements in this path.
|
boolean |
equals(Object o) |
int |
hashCode() |
boolean |
isSame(GridGgfsPath path)
Checks if paths are identical.
|
boolean |
isSubDirectoryOf(GridGgfsPath path)
Checks whether this path is a sub-directory of argument.
|
String |
name()
Returns the final component of this path.
|
GridGgfsPath |
parent()
Returns the parent of a path or
null if at root. |
void |
readExternal(ObjectInput in) |
GridGgfsPath |
root()
Returns a root for this path.
|
GridGgfsPath |
suffix(String suffix)
Adds a suffix to the final name in the path.
|
String |
toString() |
void |
writeExternal(ObjectOutput out) |
public GridGgfsPath()
public GridGgfsPath(URI uri)
uri - URI to create path from.public GridGgfsPath(String path)
path - URI string.public GridGgfsPath(GridGgfsPath parentPath, String childPath)
parentPath - Parent path.childPath - Child path.public String name()
public GridGgfsPath root()
@Nullable public GridGgfsPath parent()
null if at root.null if at root.public GridGgfsPath suffix(String suffix)
suffix - Suffix.public int depth()
public boolean isSubDirectoryOf(GridGgfsPath path)
path - Path to check.True if argument is same or a sub-directory of this object.public boolean isSame(GridGgfsPath path)
path - Path to check.True if paths are identical.public int compareTo(GridGgfsPath o)
compareTo in interface Comparable<GridGgfsPath>public void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException
readExternal in interface ExternalizableIOExceptionCopyright © 2014. All rights reserved.