From d7b34611f74871b788e68c455b25bec98f07840d Mon Sep 17 00:00:00 2001 From: Francois Prunayre Date: Thu, 8 Feb 2024 11:13:05 +0100 Subject: [PATCH] Datastore / Log error in case rename is failing. --- .../fao/geonet/api/records/attachments/FilesystemStore.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/org/fao/geonet/api/records/attachments/FilesystemStore.java b/core/src/main/java/org/fao/geonet/api/records/attachments/FilesystemStore.java index 76cac474445..f324552aeb2 100644 --- a/core/src/main/java/org/fao/geonet/api/records/attachments/FilesystemStore.java +++ b/core/src/main/java/org/fao/geonet/api/records/attachments/FilesystemStore.java @@ -335,7 +335,11 @@ public List getResources(ServiceContext context, String metada @Override public void renameFolder(Path originalPath, Path newPath) { if (Files.exists(originalPath)) { - originalPath.toFile().renameTo(newPath.toFile()); + boolean succeed = originalPath.toFile().renameTo(newPath.toFile()); + if (!succeed) { + Log.error(Geonet.RESOURCES, + String.format("Datastore issue. Failed to rename %s in %s", originalPath, newPath)); + } } }