FileSystemSupport and MutableFileSystemSupport.
A path either starts with a slash which denotes an absolute path or a segment which denotes a relative path.
Note that this is an abstraction over different 'real' file systems and doesn't understand platform specific things like, e.g.
"c:/" on windows.
The path segment separator is '/'.
| Modifier and Type | Field and Description |
|---|---|
| private final boolean | |
| public static final Path | ROOT
the root path |
| public static final char | SEGMENT_SEPARATOR
the segment separator used. |
| private final ImmutableList | |
| private static final Splitter |
| Access | Constructor and Description |
|---|---|
| public | |
| private |
| Modifier and Type | Method and Description |
|---|---|
| public Path | |
| public boolean | equals(Object obj)
Overrides java. Indicates whether some other object is "equal to" this one. |
| public Path | |
| public Path | |
| public String | Returns: the file extension ornull if this path's last segment doesn't have a file extension.
|
| public String | |
| public Path | Returns: the parent of this path or null if this path is the root path.Returns the parent of this path or null if this path is the root path. |
| public List | |
| public int | |
| private Path | |
| public boolean | |
| private Iterable | |
| public Path | Returns: the resulting relative path or null if neither of the given paths is a prefix of the othera string representing a path other)See |
| public Path | Returns: the resulting relative path or null if neither of the given paths is a prefix of the otherthe path to relativize against this path other)Constructs a relative path between this path and a given path. |
| public boolean | Returns: whether the given path is a prefix of this paththe path, which might be a prefix of this path other)Returns whether this path starts with the same segments and
has the same |
| public String |
| absolute | back to summary |
|---|---|
| private final boolean absolute | |
| ROOT | back to summary |
|---|---|
| public static final Path ROOT the root path | |
| SEGMENT_SEPARATOR | back to summary |
|---|---|
| public static final char SEGMENT_SEPARATOR the segment separator used. | |
| segments | back to summary |
|---|---|
| private final ImmutableList<String> segments | |
| splitter | back to summary |
|---|---|
| private static final Splitter splitter | |
| Path | back to summary |
|---|---|
| public Path(String pathAsString) Constructs a new Path object from a given string. the used file separator is '/' and a leading one indicates an absolute path. | |
| Path | back to summary |
|---|---|
| private Path(List<String> segments, boolean isAbsolute) | |
| append | back to summary |
|---|---|
| public Path append(String suffix) Appends the given suffix to this path. | |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Overrides java. Doc from java. Indicates whether some other object is "equal to" this one.
The
An equivalence relation partitions the elements it operates on into equivalence classes; all the members of an equivalence class are equal to each other. Members of an equivalence class are substitutable for each other, at least for some purposes.
| |
| getAbsolutePath | back to summary |
|---|---|
public Path getAbsolutePath(String relativePath)
| |
| getAbsolutePath | back to summary |
|---|---|
public Path getAbsolutePath(Path relativePath)
| |
| getFileExtension | back to summary |
|---|---|
public String getFileExtension()
| |
| getLastSegment | back to summary |
|---|---|
public String getLastSegment()
| |
| getParent | back to summary |
|---|---|
| public Path getParent() Returns the parent of this path or null if this path is the root path.
| |
| getSegments | back to summary |
|---|---|
| public List | |
| hashCode | back to summary |
|---|---|
| public int hashCode() Overrides java. Doc from java. Returns a hash code value for this object. This method is
supported for the benefit of hash tables such as those provided by
The general contract of
| |
| internalRelativize | back to summary |
|---|---|
| private Path internalRelativize(Path path, Path prefix) | |
| isAbsolute | back to summary |
|---|---|
public boolean isAbsolute()
| |
| normalize | back to summary |
|---|---|
| private Iterable | |
| relativize | back to summary |
|---|---|
| public Path relativize(String other) See | |
| relativize | back to summary |
|---|---|
| public Path relativize(Path other) Constructs a relative path between this path and a given path. Relativization is the inverse of
| |
| startsWith | back to summary |
|---|---|
| public boolean startsWith(Path other) Returns whether this path starts with the same segments and
has the same
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Doc from java. Returns a string representation of the object.
Satisfying this method's contract implies a non-
| |