public FileChannel newFileChannel (Path path, Set<? extends OpenOption> options, FileAttribute<?>… attrs) throws IOException

Opens or creates a file for reading and/or writing, returning a file channel to access the file. This method works in exactly the manner specified by the FileChannel.open(Path,Set,FileAttribute[]) method. A provider that does not support all the features required to construct a file channel throws UnsupportedOperationException. The default provider is required to support the creation of file channels. When not overridden, the default implementation throws UnsupportedOperationException.

Parameters:
path     the path of the file to open or create
options     options specifying how the file is opened
attrs     an optional list of file attributes to set atomically when creating the file

Returns:  a new file channel

Exceptions:
IllegalArgumentException     If the set contains an invalid combination of options
UnsupportedOperationException     If this provider that does not support creating 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