Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Duplicate
-
None
-
None
-
None
-
None
Description
Path path1 = ((FSDirectory) baseFromDir).getDirectory().toAbsolutePath(); Path path2 = ((FSDirectory) baseFromDir).getDirectory().toAbsolutePath(); try { Files.move(path1.resolve(fileName), path2.resolve(fileName), StandardCopyOption.ATOMIC_MOVE); } catch (AtomicMoveNotSupportedException e) { Files.move(path1.resolve(fileName), path2.resolve(fileName)); }
Because path1 == path2 this code never does anything and move always defaults to the less efficient implementation in DirectoryFactory.