public class FilePathComponents extends Object
Modifier and Type | Field and Description |
---|---|
File |
root
|
List<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(File root,
List<File> segments) |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object o) |
int |
hashCode() |
boolean |
isRooted()
Returns
true when the root is not empty. |
FilePathComponents |
normalize() |
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.
|
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 File root
public String rootName()
public boolean isRooted()
true
when the root
is not empty.public int size()
public File subPath(int beginIndex, int endIndex)
beginIndex
and up
to the specified endIndex
.public FilePathComponents normalize()
Copyright © 2024. All rights reserved.