Although the existence and description of the ATOMIC_MOVE option imply the possibility of the Files.move operation not being performed as a atomic operation, this is not explicitly stated. For example, if REPLACE_EXISTING is specified, a file having the same path as the move target might be deleted and then another file created in the same location before the actual move occurs. This will result in a potentially confusing FileAlreadyExistsException as described in JDK-8150700.
- csr for
-
JDK-8323194 (fs) Clarify non-atomic behavior of Files.move
- Closed
- relates to
-
JDK-8325302 Files.move(REPLACE_EXISTING) throws NoSuchFileException on deleted target
- Resolved
-
JDK-8150700 (fs) FileAlreadyExistsException with Files.move with REPLACE_EXISTING
- Closed