Modifier and Type | Class and Description |
---|---|
static class |
DirEntry.Type
types of file, we distignuish.
|
Modifier and Type | Field and Description |
---|---|
java.nio.file.attribute.BasicFileAttributes |
attr
the file attributes for this instance.
|
java.nio.file.Path |
opath
the original path associated with this entry.
|
java.nio.file.Path |
path
the path associated with this entry.
|
Constructor and Description |
---|
DirEntry(java.nio.file.Path path,
boolean resolve,
java.nio.file.attribute.BasicFileAttributes attrs)
Create a new instance.
|
Modifier and Type | Method and Description |
---|---|
String |
getName()
Get the basename of this entry in the original directory.
|
DirEntry.Type |
getType()
Get the type of the entry.
|
static DirEntry.Type |
getType(java.nio.file.Path path,
java.nio.file.attribute.BasicFileAttributes attributes)
Get the type of an dir entry depending on its file attributes.
|
public final java.nio.file.Path path
public final java.nio.file.Path opath
path
if
this is not a symlinkpublic final java.nio.file.attribute.BasicFileAttributes attr
null
.public DirEntry(java.nio.file.Path path, boolean resolve, java.nio.file.attribute.BasicFileAttributes attrs)
path
- path associated with this instance.resolve
- if true
resolve the path to its final destination,
if it is a symlink.attrs
- file attributes for this instance. Might be null
.public String getName()
public DirEntry.Type getType()
null
.public static DirEntry.Type getType(java.nio.file.Path path, java.nio.file.attribute.BasicFileAttributes attributes)
path
- the path to analyzeattributes
- file attributes to use. If null
, attributes
are retrieved on the fly.null
.Created by Jens Elkner