From fef607ec4a65645ba8351964d5a8beddaf8feffc Mon Sep 17 00:00:00 2001 From: Ludy Date: Wed, 30 Jul 2025 20:28:37 +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> --- .../java/stirling/software/common/util/GeneralUtils.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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 9d465c207..fc2d42b76 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 @@ -538,7 +538,12 @@ public class GeneralUtils { Path tmp = Files.createTempFile(dir, target.getFileName().toString(), ".tmp"); try (InputStream in = resource.getInputStream()) { Files.copy(in, tmp, StandardCopyOption.REPLACE_EXISTING); - Files.move(tmp, target, StandardCopyOption.ATOMIC_MOVE); + try { + Files.move(tmp, target, StandardCopyOption.ATOMIC_MOVE); + } catch (AtomicMoveNotSupportedException e) { + 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); try {