Opens or creates a file for reading and/or writing, returning an
asynchronous file channel to access the file. This method works in
exactly the manner specified by the AsynchronousFileChannel.open(Path,Set,ExecutorService,FileAttribute[])
method.
A provider that does not support all the features required to construct
an asynchronous file channel throws UnsupportedOperationException
.
The default provider is required to support the creation of asynchronous
file channels. When not overridden, the default implementation of this
method throws UnsupportedOperationException
.
path
| the path of the file to open or create | |
options
| options specifying how the file is opened | |
executor
| the thread pool or null to associate the channel with
the default thread pool | |
attrs
| an optional list of file attributes to set atomically when creating the file |
IllegalArgumentException
| If the set contains an invalid combination of options | |
UnsupportedOperationException
| If this provider that does not support creating asynchronous file channels, or an unsupported open option or file attribute is specified | |
IOException
| If an I/O error occurs | |
SecurityException
| In the case of the default file system, the SecurityManager.checkRead(String) method is invoked to check
read access if the file is opened for reading. The SecurityManager.checkWrite(String) method is invoked to check
write access if the file is opened for writing |
Diagram: FileSystem