From 98f7f153f6739dbbd9ca97c1fbcf1944a5c7cdac Mon Sep 17 00:00:00 2001 From: Ludy Date: Wed, 30 Jul 2025 20:35:47 +0200 Subject: [PATCH] Update app/common/src/main/java/stirling/software/common/util/GeneralUtils.java Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .../stirling/software/common/util/GeneralUtils.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/app/common/src/main/java/stirling/software/common/util/GeneralUtils.java b/app/common/src/main/java/stirling/software/common/util/GeneralUtils.java index fc2d42b76..36c0e9526 100644 --- a/app/common/src/main/java/stirling/software/common/util/GeneralUtils.java +++ b/app/common/src/main/java/stirling/software/common/util/GeneralUtils.java @@ -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) {