Sets the owner's or everybody's execute permission for this abstract pathname. On some platforms it may be possible to start the Java virtual machine with special privileges that allow it to execute files that are not marked executable.
The java.nio.file.Files class defines methods that operate on
file attributes including file permissions. This may be used when finer
manipulation of file permissions is required.
executable
| If true, sets the access permission to allow execute
operations; if false to disallow execute operations | |
ownerOnly
| If true, the execute permission applies only to the
owner's execute permission; otherwise, it applies to everybody.
If the underlying file system can not distinguish the owner's
execute permission from that of others, then the permission will
apply to everybody, regardless of this value. |
true if and only if the operation succeeded. The
operation will fail if the user does not have permission to
change the access permissions of this abstract pathname. If
executable is false and the underlying
file system does not implement an execute permission, then the
operation will fail.
SecurityException
| If a security manager exists and its java.lang.SecurityManager.checkWrite(java.lang.String)
method denies write access to the file |
Diagram: File