From 78291e0ef81459e2180fefc8c49aed979e54d6c6 Mon Sep 17 00:00:00 2001 From: Lucio Lelii Date: Tue, 20 Nov 2018 16:31:26 +0000 Subject: [PATCH] git-svn-id: https://svn.d4science-ii.research-infrastructures.eu/gcube/branches/data-access/storagehub-webapp/1.0@174263 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../data/access/storagehub/services/ItemsManager.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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 86b7710..f14c640 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 @@ -652,7 +652,7 @@ public class ItemsManager { ses.getWorkspace().copy(nodeToCopy.getPath(), newPath); Node newNode = ses.getNode(newPath); newFileIdentifier = newNode.getIdentifier(); - //TODO: copy on storage and modify content + if (item instanceof AbstractFileItem) { String oldStorageId = ((AbstractFileItem)item).getContent().getStorageId(); String newStorageID = Utils.getStorageClient(login).getClient().copyFile(true).from(oldStorageId).to(newPath); @@ -660,12 +660,15 @@ public class ItemsManager { ((AbstractFileItem) item).getContent().setStorageId(newStorageID); ((AbstractFileItem) item).getContent().setRemotePath(newPath); item2Node.replaceContent(ses, newNode, (AbstractFileItem) item, ItemAction.CLONED); - } else - Utils.setPropertyOnChangeNode(newNode, login, ItemAction.CLONED); + } + + Utils.setPropertyOnChangeNode(newNode, login, ItemAction.CLONED); + newNode.setProperty(NodeProperty.PORTAL_LOGIN.toString(), login); String mimeTypeForAccounting = (item instanceof AbstractFileItem)? ((AbstractFileItem) item).getContent().getMimeType(): null; accountingHandler.createFolderAddObj(uniqueName, item.getClass().getSimpleName(), mimeTypeForAccounting, ses, destination, false); + ses.save(); }finally {