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