Fix: FileAlreadyExistsException during archive copy

This commit is contained in:
Grische
2024-07-13 12:11:00 +00:00
committed by Laurent Clouet
parent 495e6a9ae5
commit 5b6d68f629

View File

@@ -81,6 +81,7 @@ public class DirectoryManager {
} }
try { try {
Files.deleteIfExists(targetArchivePath); // createLink only works if the target does not exist
try { try {
Files.createLink(targetArchivePath, existingArchivePath); Files.createLink(targetArchivePath, existingArchivePath);
log.debug("Created hardlink from " + targetArchivePath + " to " + existingArchivePath); log.debug("Created hardlink from " + targetArchivePath + " to " + existingArchivePath);