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 IgfsPath |
ROOT
Root path.
|
static String |
SLASH
The directory separator.
|
Constructor and Description |
---|
IgfsPath()
Default constructor.
|
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 |
isSubDirectoryOf(IgfsPath path)
Checks whether this path is a sub-directory of argument.
|
String |
name()
Returns the final component of this path.
|
@Nullable 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) |
void |
readRawBinary(BinaryRawReader reader)
Read raw binary.
|
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) |
void |
writeRawBinary(BinaryRawWriter writer)
Write raw binary.
|
public static final String SLASH
public static final IgfsPath ROOT
public IgfsPath()
public IgfsPath(URI uri)
uri
- URI to create path from.public IgfsPath(String path)
path
- URI string.public String name()
public List<String> components()
public String[] componentsArray()
@Nullable public @Nullable 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 int compareTo(IgfsPath o)
compareTo
in interface Comparable<IgfsPath>
public void writeExternal(ObjectOutput out) throws IOException
writeExternal
in interface Externalizable
IOException
public void readExternal(ObjectInput in) throws IOException
readExternal
in interface Externalizable
IOException
public void writeBinary(BinaryWriter writer) throws BinaryObjectException
writeBinary
in interface Binarylizable
writer
- Binary object writer.BinaryObjectException
- In case of error.public void readBinary(BinaryReader reader) throws BinaryObjectException
readBinary
in interface Binarylizable
reader
- Binary object reader.BinaryObjectException
- In case of error.public void writeRawBinary(BinaryRawWriter writer) throws BinaryObjectException
writer
- Raw writer.BinaryObjectException
- If failed.public void readRawBinary(BinaryRawReader reader) throws BinaryObjectException
reader
- Raw reader.BinaryObjectException
- If failed.
Follow @ApacheIgnite
Ignite Database and Caching Platform : ver. 2.7.2 Release Date : February 6 2019