mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-27 06:45:07 +02:00
8316000: File.setExecutable silently fails if file does not exist
Reviewed-by: alanb
This commit is contained in:
parent
a185be0346
commit
49376e4452
1 changed files with 36 additions and 24 deletions
|
@ -1621,6 +1621,12 @@ public class File
|
||||||
* file attributes including file permissions. This may be used when finer
|
* file attributes including file permissions. This may be used when finer
|
||||||
* manipulation of file permissions is required.
|
* manipulation of file permissions is required.
|
||||||
*
|
*
|
||||||
|
* <p> If the platform supports setting a file's read permission, but
|
||||||
|
* the user does not have permission to change the access permissions of
|
||||||
|
* this abstract pathname, then the operation will fail. If the platform
|
||||||
|
* does not support setting a file's read permission, this method does
|
||||||
|
* nothing and returns the value of the {@code readable} parameter.
|
||||||
|
*
|
||||||
* @param readable
|
* @param readable
|
||||||
* If {@code true}, sets the access permission to allow read
|
* If {@code true}, sets the access permission to allow read
|
||||||
* operations; if {@code false} to disallow read operations
|
* operations; if {@code false} to disallow read operations
|
||||||
|
@ -1632,12 +1638,9 @@ public class File
|
||||||
* permission from that of others, then the permission will apply to
|
* permission from that of others, then the permission will apply to
|
||||||
* everybody, regardless of this value.
|
* everybody, regardless of this value.
|
||||||
*
|
*
|
||||||
* @return {@code true} if and only if the operation succeeded. The
|
* @return {@code true} if the operation succeeds, {@code false} if it
|
||||||
* operation will fail if the user does not have permission to
|
* fails, or the value of the {@code readable} parameter if
|
||||||
* change the access permissions of this abstract pathname. If
|
* setting the read permission is not supported.
|
||||||
* {@code readable} is {@code false} and the underlying
|
|
||||||
* file system does not implement a read permission, then the
|
|
||||||
* operation will fail.
|
|
||||||
*
|
*
|
||||||
* @throws SecurityException
|
* @throws SecurityException
|
||||||
* If a security manager exists and its {@link
|
* If a security manager exists and its {@link
|
||||||
|
@ -1671,16 +1674,19 @@ public class File
|
||||||
* file.setReadable(arg, true)
|
* file.setReadable(arg, true)
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
|
* <p> If the platform supports setting a file's read permission, but
|
||||||
|
* the user does not have permission to change the access permissions of
|
||||||
|
* this abstract pathname, then the operation will fail. If the platform
|
||||||
|
* does not support setting a file's read permission, this method does
|
||||||
|
* nothing and returns the value of the {@code readable} parameter.
|
||||||
|
*
|
||||||
* @param readable
|
* @param readable
|
||||||
* If {@code true}, sets the access permission to allow read
|
* If {@code true}, sets the access permission to allow read
|
||||||
* operations; if {@code false} to disallow read operations
|
* operations; if {@code false} to disallow read operations
|
||||||
*
|
*
|
||||||
* @return {@code true} if and only if the operation succeeded. The
|
* @return {@code true} if the operation succeeds, {@code false} if it
|
||||||
* operation will fail if the user does not have permission to
|
* fails, or the value of the {@code readable} parameter if
|
||||||
* change the access permissions of this abstract pathname. If
|
* setting the read permission is not supported.
|
||||||
* {@code readable} is {@code false} and the underlying
|
|
||||||
* file system does not implement a read permission, then the
|
|
||||||
* operation will fail.
|
|
||||||
*
|
*
|
||||||
* @throws SecurityException
|
* @throws SecurityException
|
||||||
* If a security manager exists and its {@link
|
* If a security manager exists and its {@link
|
||||||
|
@ -1703,6 +1709,12 @@ public class File
|
||||||
* file attributes including file permissions. This may be used when finer
|
* file attributes including file permissions. This may be used when finer
|
||||||
* manipulation of file permissions is required.
|
* manipulation of file permissions is required.
|
||||||
*
|
*
|
||||||
|
* <p> If the platform supports setting a file's execute permission, but
|
||||||
|
* the user does not have permission to change the access permissions of
|
||||||
|
* this abstract pathname, then the operation will fail. If the platform
|
||||||
|
* does not support setting a file's execute permission, this method does
|
||||||
|
* nothing and returns the value of the {@code executable} parameter.
|
||||||
|
*
|
||||||
* @param executable
|
* @param executable
|
||||||
* If {@code true}, sets the access permission to allow execute
|
* If {@code true}, sets the access permission to allow execute
|
||||||
* operations; if {@code false} to disallow execute operations
|
* operations; if {@code false} to disallow execute operations
|
||||||
|
@ -1714,12 +1726,9 @@ public class File
|
||||||
* execute permission from that of others, then the permission will
|
* execute permission from that of others, then the permission will
|
||||||
* apply to everybody, regardless of this value.
|
* apply to everybody, regardless of this value.
|
||||||
*
|
*
|
||||||
* @return {@code true} if and only if the operation succeeded. The
|
* @return {@code true} if the operation succeeds, {@code false} if it
|
||||||
* operation will fail if the user does not have permission to
|
* fails, or the value of the {@code executable} parameter if
|
||||||
* change the access permissions of this abstract pathname. If
|
* setting the execute permission is not supported.
|
||||||
* {@code executable} is {@code false} and the underlying
|
|
||||||
* file system does not implement an execute permission, then the
|
|
||||||
* operation will fail.
|
|
||||||
*
|
*
|
||||||
* @throws SecurityException
|
* @throws SecurityException
|
||||||
* If a security manager exists and its {@link
|
* If a security manager exists and its {@link
|
||||||
|
@ -1753,16 +1762,19 @@ public class File
|
||||||
* file.setExecutable(arg, true)
|
* file.setExecutable(arg, true)
|
||||||
* }
|
* }
|
||||||
*
|
*
|
||||||
|
* <p> If the platform supports setting a file's execute permission, but
|
||||||
|
* the user does not have permission to change the access permissions of
|
||||||
|
* this abstract pathname, then the operation will fail. If the platform
|
||||||
|
* does not support setting a file's execute permission, this method does
|
||||||
|
* nothing and returns the value of the {@code executable} parameter.
|
||||||
|
*
|
||||||
* @param executable
|
* @param executable
|
||||||
* If {@code true}, sets the access permission to allow execute
|
* If {@code true}, sets the access permission to allow execute
|
||||||
* operations; if {@code false} to disallow execute operations
|
* operations; if {@code false} to disallow execute operations
|
||||||
*
|
*
|
||||||
* @return {@code true} if and only if the operation succeeded. The
|
* @return {@code true} if the operation succeeds, {@code false} if it
|
||||||
* operation will fail if the user does not have permission to
|
* fails, or the value of the {@code executable} parameter if
|
||||||
* change the access permissions of this abstract pathname. If
|
* setting the execute permission is not supported.
|
||||||
* {@code executable} is {@code false} and the underlying
|
|
||||||
* file system does not implement an execute permission, then the
|
|
||||||
* operation will fail.
|
|
||||||
*
|
*
|
||||||
* @throws SecurityException
|
* @throws SecurityException
|
||||||
* If a security manager exists and its {@link
|
* If a security manager exists and its {@link
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue