public class FilePathComponents
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
java.io.File |
root
The
File object representing root of the path (for example, / or C: or empty for relative paths). |
java.util.List<java.io.File> |
segments
The list of
File objects representing every directory in the path to the file, up to an including the file itself. |
| Constructor and Description |
|---|
FilePathComponents(java.io.File root,
java.util.List<java.io.File> segments) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object o) |
int |
hashCode() |
boolean |
isRooted()
Returns
true when the root is not empty. |
FilePathComponents |
normalize() |
java.lang.String |
rootName()
Returns a string representing the root for this file, or an empty string is this file name is relative.
|
int |
size()
Returns the number of elements in the path to the file.
|
java.io.File |
subPath(int beginIndex,
int endIndex)
Returns a sub-path of the path, starting with the directory at the specified
beginIndex and up
to the specified endIndex. |
public final java.io.File root
File object representing root of the path (for example, / or C: or empty for relative paths).public final java.util.List<java.io.File> segments
File objects representing every directory in the path to the file, up to an including the file itself.public FilePathComponents(java.io.File root,
java.util.List<java.io.File> segments)
public java.lang.String rootName()
public boolean isRooted()
true when the root is not empty.public int size()
public java.io.File subPath(int beginIndex,
int endIndex)
beginIndex and up
to the specified endIndex.public FilePathComponents normalize()
public boolean equals(java.lang.Object o)
equals in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.ObjectCopyright © 2022. All rights reserved.