From 05be68b22058a80140b8a70124f09664d6668373 Mon Sep 17 00:00:00 2001 From: Lucio Lelii Date: Fri, 16 Nov 2018 11:12:49 +0000 Subject: [PATCH] git-svn-id: https://svn.d4science-ii.research-infrastructures.eu/gcube/branches/data-access/storagehub-webapp/1.0@174185 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../gcube/data/access/storagehub/services/ItemsManager.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/gcube/data/access/storagehub/services/ItemsManager.java b/src/main/java/org/gcube/data/access/storagehub/services/ItemsManager.java index 72793f4..3f02823 100644 --- a/src/main/java/org/gcube/data/access/storagehub/services/ItemsManager.java +++ b/src/main/java/org/gcube/data/access/storagehub/services/ItemsManager.java @@ -654,7 +654,9 @@ public class ItemsManager { newFileIdentifier = newNode.getIdentifier(); //TODO: copy on storage and modify content if (item instanceof AbstractFileItem) { - String newStorageID = Utils.getStorageClient(login).getClient().copyFile().from(((AbstractFileItem)item).getContent().getStorageId()).to(newPath); + String oldStorageId = ((AbstractFileItem)item).getContent().getStorageId(); + String newStorageID = Utils.getStorageClient(login).getClient().copyFile().from(oldStorageId).to(newPath); + log.info("copying storage Id {} to newPath {} and the id returned by storage is {}", oldStorageId, newPath, newStorageID); ((AbstractFileItem) item).getContent().setStorageId(newStorageID); ((AbstractFileItem) item).getContent().setRemotePath(newPath); item2Node.replaceContent(ses, newNode, (AbstractFileItem) item, ItemAction.CLONED);