public static FileChannel open (Path path, OpenOption… options) throws IOException

Opens or creates a file, returning a file channel to access the file.

An invocation of this method behaves in exactly the same way as the invocation

     fc.open(file, opts, new FileAttribute<?>[0]);
 
where opts is a set of the options specified in the options array.

Parameters:
path     The path of the file to open or create
options     Options specifying how the file is opened

Returns:  A new file channel

Exceptions:
IllegalArgumentException     If the set contains an invalid combination of options
UnsupportedOperationException     If the path is associated with a provider that does not support creating file channels, or an unsupported open option is specified
IOException     If an I/O error occurs
SecurityException     If a security manager is installed and it denies an unspecified permission required by the implementation. In the case of the default provider, 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

Since:  1.7