public boolean setExecutable (boolean executable, boolean ownerOnly)

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.

Parameters:
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.

Returns:  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.

Exceptions:
SecurityException     If a security manager exists and its java.lang.SecurityManager.checkWrite(java.lang.String) method denies write access to the file

Since:  1.6