public final class IgfsPath extends Object implements Comparable<IgfsPath>, Externalizable, Binarylizable
IGFS path to file in the file system. For example, to get information about
a file you would use the following code:
IgfsPath dirPath = new IgfsPath("/my/working/dir");
IgfsPath filePath = new IgfsPath(dirPath, "file.txt");
// Get metadata about file.
IgfsFile file = igfs.info(filePath);
| Modifier and Type | Field and Description |
|---|---|
static String |
SLASH
The directory separator.
|
| Constructor and Description |
|---|
IgfsPath()
Constructs default root path.
|
IgfsPath(IgfsPath parentPath,
String childPath)
Resolve a child path against a parent path.
|
IgfsPath(String path)
Constructs a path from the URI string.
|
IgfsPath(URI uri)
Constructs a path from an URI
|
| Modifier and Type | Method and Description |
|---|---|
int |
compareTo(IgfsPath o) |
List<String> |
components()
Split full path on components.
|
String[] |
componentsArray()
Get components in array form.
|
int |
depth()
Return the number of elements in this path.
|
boolean |
equals(Object o) |
int |
hashCode() |
boolean |
isSame(IgfsPath path)
Checks if paths are identical.
|
boolean |
isSubDirectoryOf(IgfsPath path)
Checks whether this path is a sub-directory of argument.
|
String |
name()
Returns the final component of this path.
|
IgfsPath |
parent()
Returns the parent of a path or
null if at root. |
void |
readBinary(BinaryReader reader)
Reads fields from provided reader.
|
void |
readExternal(ObjectInput in) |
IgfsPath |
root()
Returns a root for this path.
|
IgfsPath |
suffix(String suffix)
Adds a suffix to the final name in the path.
|
String |
toString() |
void |
writeBinary(BinaryWriter writer)
Writes fields to provided writer.
|
void |
writeExternal(ObjectOutput out) |
public static final String SLASH
public IgfsPath()
public IgfsPath(URI uri)
uri - URI to create path from.public IgfsPath(String path)
path - URI string.public String name()
public IgfsPath root()
public String[] componentsArray()
@Nullable public IgfsPath parent()
null if at root.null if at root.public IgfsPath suffix(String suffix)
suffix - Suffix.public int depth()
public boolean isSubDirectoryOf(IgfsPath path)
path - Path to check.True if argument is same or a sub-directory of this object.public boolean isSame(IgfsPath path)
path - Path to check.True if paths are identical.public int compareTo(IgfsPath o)
compareTo in interface Comparable<IgfsPath>public void writeExternal(ObjectOutput out) throws IOException
writeExternal in interface ExternalizableIOExceptionpublic void readExternal(ObjectInput in) throws IOException
readExternal in interface ExternalizableIOExceptionpublic void writeBinary(BinaryWriter writer) throws BinaryObjectException
writeBinary in interface Binarylizablewriter - Binary object writer.BinaryObjectException - In case of error.public void readBinary(BinaryReader reader) throws BinaryObjectException
readBinary in interface Binarylizablereader - Binary object reader.BinaryObjectException - In case of error.
Follow @ApacheIgnite
Ignite Fabric : ver. 1.5.11 Release Date : April 8 2016