| Package | Description |
|---|---|
| java.nio.file |
Defines interfaces and classes for the Java virtual machine to access files, file attributes, and file systems.
|
| java.nio.file.spi |
Service-provider classes for the
java.nio.file package.
|
| Modifier and Type | Method and Description |
|---|---|
static LinkOption |
LinkOption.valueOf(String
Returns the enum constant of this type with the specified name.
|
static LinkOption |
LinkOption.values()
Returns an array containing the constants of this enum type, in the order they are declared.
|
| Modifier and Type | Method and Description |
|---|---|
static boolean |
Files.exists(Path
Tests whether a file exists.
|
static Object |
Files.getAttribute(Path
Reads the value of a file attribute.
|
static <V extends FileAttributeView |
Files.getFileAttributeView(Path
Returns a file attribute view of a given type.
|
<V extends FileAttributeView |
SecureDirectoryStream.getFileAttributeView(T path, Class
Returns a new file attribute view to access the file attributes of a file in this directory.
|
static FileTime |
Files.getLastModifiedTime(Path
Returns a file's last modified time.
|
static UserPrincipal |
Files.getOwner(Path
Returns the owner of a file.
|
static Set |
Files.getPosixFilePermissions(Path
Returns a file's POSIX file permissions.
|
static boolean |
Files.isDirectory(Path
Tests whether a file is a directory.
|
static boolean |
Files.isRegularFile(Path
Tests whether a file is a regular file with opaque content.
|
SecureDirectoryStream |
SecureDirectoryStream.newDirectoryStream(T path, LinkOption
Opens the directory identified by the given path, returning a
SecureDirectoryStream to iterate over the entries in the directory.
|
static boolean |
Files.notExists(Path
Tests whether the file located by this path does not exist.
|
static <A extends BasicFileAttributes |
Files.readAttributes(Path
Reads a file's attributes as a bulk operation.
|
static Map |
Files.readAttributes(Path
Reads a set of file attributes as a bulk operation.
|
static Path |
Files.setAttribute(Path
Sets the value of a file attribute.
|
Path |
Path.toRealPath(LinkOption
Returns the
real path of an existing file.
|
| Modifier and Type | Method and Description |
|---|---|
abstract <V extends FileAttributeView |
FileSystemProvider.getFileAttributeView(Path
Returns a file attribute view of a given type.
|
abstract <A extends BasicFileAttributes |
FileSystemProvider.readAttributes(Path
Reads a file's attributes as a bulk operation.
|
abstract Map |
FileSystemProvider.readAttributes(Path
Reads a set of file attributes as a bulk operation.
|
abstract void |
FileSystemProvider.setAttribute(Path
Sets the value of a file attribute.
|