Skip to content

Commit 9ed893e

Browse files
committed
first orphanize, then remove content
1 parent 28566e5 commit 9ed893e

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/main/java/org/cryptomator/cryptofs/CryptoFileSystemImpl.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -630,11 +630,12 @@ private void moveDirectory(CryptoPath cleartextSource, CryptoPath cleartextTarge
630630
} catch (NoSuchFileException e) {
631631
targetCiphertextDirExists = false;
632632
}
633-
// cleanup dir to be replaced:
633+
//delete dir link
634+
Files.walkFileTree(ciphertextTarget.getRawPath(), DeletingFileVisitor.INSTANCE);
635+
// cleanup content dir
634636
if (targetCiphertextDirExists) {
635637
Files.walkFileTree(targetCiphertextDirContentDir, DeletingFileVisitor.INSTANCE);
636638
}
637-
Files.walkFileTree(ciphertextTarget.getRawPath(), DeletingFileVisitor.INSTANCE);
638639
}
639640

640641
// no exceptions until this point, so MOVE:

0 commit comments

Comments
 (0)