Update app/common/src/main/java/stirling/software/common/util/GeneralUtils.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
Ludy 2025-07-30 20:35:47 +02:00 committed by GitHub
parent fef607ec4a
commit 98f7f153f6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -544,8 +544,14 @@ public class GeneralUtils {
log.warn("Atomic move not supported, falling back to non-atomic move for {}", target, e);
Files.move(tmp, target, StandardCopyOption.REPLACE_EXISTING);
}
} catch (FileAlreadyExistsException e) {
log.debug("File already exists at {}", target);
} catch (FileSystemException e) {
if (e instanceof FileAlreadyExistsException) {
log.debug("File already exists at {}", target);
} else if (e instanceof AccessDeniedException) {
log.error("Access denied while attempting to move file to {}", target, e);
} else {
log.error("File system error occurred while moving file to {}", target, e);
}
try {
Files.deleteIfExists(tmp);
} catch (IOException ex) {