8321561: (fs) Clarify non-atomic behavior of Files.move

Reviewed-by: alanb
This commit is contained in:
Brian Burkhalter 2024-01-17 16:34:33 +00:00
parent 8b29e127c2
commit 19287eeeb2

View file

@ -1359,6 +1359,9 @@ public final class Files {
* associated with a different provider to this object. </td>
* </tbody>
* </table>
* If the {@code ATOMIC_MOVE} option is not specified, then the check
* whether the target file exists and the actual move might not be atomic
* with respect to other filesystem activities.
*
* <p> An implementation of this interface may support additional
* implementation specific options.
@ -1404,8 +1407,11 @@ public final class Files {
* if the array contains a copy option that is not supported
* @throws FileAlreadyExistsException
* if the target file exists but cannot be replaced because the
* {@code REPLACE_EXISTING} option is not specified <i>(optional
* specific exception)</i>
* {@code REPLACE_EXISTING} option is <i>not</i> specified.
* It may also be thrown when the {@code REPLACE_EXISTING} option
* <i>is</i> specified, the move is not atomic, and the target
* file is created by some other entity at around the same time
* that this method is called
* @throws DirectoryNotEmptyException
* the {@code REPLACE_EXISTING} option is specified but the file
* cannot be replaced because it is a non-empty directory, or the