Skip to content

Most visited

Recently visited

navigation
added in API level 26

java.nio.file

Interfaces

CopyOption An object that configures how to copy or move a file. 
DirectoryStream<T> An object to iterate over the entries in a directory. 
DirectoryStream.Filter<T> An interface that is implemented by objects that decide if a directory entry should be accepted or filtered. 
FileVisitor<T> A visitor of files. 
OpenOption An object that configures how to open or create a file. 
Path An object that may be used to locate a file in a file system. 
PathMatcher An interface that is implemented by objects that perform match operations on paths. 
SecureDirectoryStream<T> A DirectoryStream that defines operations on files that are located relative to an open directory. 
Watchable An object that may be registered with a watch service so that it can be watched for changes and events. 
WatchEvent<T> An event or a repeated event for an object that is registered with a WatchService
WatchEvent.Kind<T> An event kind, for the purposes of identification. 
WatchEvent.Modifier An event modifier that qualifies how a Watchable is registered with a WatchService
WatchKey A token representing the registration of a watchable object with a WatchService
WatchService A watch service that watches registered objects for changes and events. 

Classes

Files This class consists exclusively of static methods that operate on files, directories, or other types of files. 
FileStore Storage for files. 
FileSystem Provides an interface to a file system and is the factory for objects to access files and other objects in the file system. 
FileSystems Factory methods for file systems. 
LinkPermission The Permission class for link creation operations. 
Paths This class consists exclusively of static methods that return a Path by converting a path string or URI
SimpleFileVisitor<T> A simple visitor of files with default behavior to visit all files and to re-throw I/O errors. 
StandardWatchEventKinds Defines the standard event kinds. 

Enums

AccessMode Defines access modes used to test the accessibility of a file. 
FileVisitOption Defines the file tree traversal options. 
FileVisitResult The result type of a FileVisitor
LinkOption Defines the options as to how symbolic links are handled. 
StandardCopyOption Defines the standard copy options. 
StandardOpenOption Defines the standard open options. 

Exceptions

AccessDeniedException Checked exception thrown when a file system operation is denied, typically due to a file permission or other access check. 
AtomicMoveNotSupportedException Checked exception thrown when a file cannot be moved as an atomic file system operation. 
ClosedDirectoryStreamException Unchecked exception thrown when an attempt is made to invoke an operation on a directory stream that is closed. 
ClosedFileSystemException Unchecked exception thrown when an attempt is made to invoke an operation on a file and the file system is closed. 
ClosedWatchServiceException Unchecked exception thrown when an attempt is made to invoke an operation on a watch service that is closed. 
DirectoryIteratorException Runtime exception thrown if an I/O error is encountered when iterating over the entries in a directory. 
DirectoryNotEmptyException Checked exception thrown when a file system operation fails because a directory is not empty. 
FileAlreadyExistsException Checked exception thrown when an attempt is made to create a file or directory and a file of that name already exists. 
FileSystemAlreadyExistsException Runtime exception thrown when an attempt is made to create a file system that already exists. 
FileSystemException Thrown when a file system operation fails on one or two files. 
FileSystemLoopException Checked exception thrown when a file system loop, or cycle, is encountered. 
FileSystemNotFoundException Runtime exception thrown when a file system cannot be found. 
InvalidPathException Unchecked exception thrown when path string cannot be converted into a Path because the path string contains invalid characters, or the path string is invalid for other file system specific reasons. 
NoSuchFileException Checked exception thrown when an attempt is made to access a file that does not exist. 
NotDirectoryException Checked exception thrown when a file system operation, intended for a directory, fails because the file is not a directory. 
NotLinkException Checked exception thrown when a file system operation fails because a file is not a symbolic link. 
ProviderMismatchException Unchecked exception thrown when an attempt is made to invoke a method on an object created by one file system provider with a parameter created by a different file system provider. 
ProviderNotFoundException Runtime exception thrown when a provider of the required type cannot be found. 
ReadOnlyFileSystemException Unchecked exception thrown when an attempt is made to update an object associated with a read-only FileSystem
This site uses cookies to store your preferences for site-specific language and display options.

Get the latest Android developer news and tips that will help you find success on Google Play.

* Required Fields

Hooray!

Browse this site in ?

You requested a page in , but your language preference for this site is .

Would you like to change your language preference and browse this site in ? If you want to change your language preference later, use the language menu at the bottom of each page.

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.

Take a short survey?
Help us improve the Android developer experience.
(Sep 2017 survey)