git-svn-id: https://svn.d4science-ii.research-infrastructures.eu/gcube/branches/data-access/storagehub-webapp/1.0@174263 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
12ff4fcbeb
commit
78291e0ef8
|
@ -652,7 +652,7 @@ public class ItemsManager {
|
||||||
ses.getWorkspace().copy(nodeToCopy.getPath(), newPath);
|
ses.getWorkspace().copy(nodeToCopy.getPath(), newPath);
|
||||||
Node newNode = ses.getNode(newPath);
|
Node newNode = ses.getNode(newPath);
|
||||||
newFileIdentifier = newNode.getIdentifier();
|
newFileIdentifier = newNode.getIdentifier();
|
||||||
//TODO: copy on storage and modify content
|
|
||||||
if (item instanceof AbstractFileItem) {
|
if (item instanceof AbstractFileItem) {
|
||||||
String oldStorageId = ((AbstractFileItem)item).getContent().getStorageId();
|
String oldStorageId = ((AbstractFileItem)item).getContent().getStorageId();
|
||||||
String newStorageID = Utils.getStorageClient(login).getClient().copyFile(true).from(oldStorageId).to(newPath);
|
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().setStorageId(newStorageID);
|
||||||
((AbstractFileItem) item).getContent().setRemotePath(newPath);
|
((AbstractFileItem) item).getContent().setRemotePath(newPath);
|
||||||
item2Node.replaceContent(ses, newNode, (AbstractFileItem) item, ItemAction.CLONED);
|
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;
|
String mimeTypeForAccounting = (item instanceof AbstractFileItem)? ((AbstractFileItem) item).getContent().getMimeType(): null;
|
||||||
accountingHandler.createFolderAddObj(uniqueName, item.getClass().getSimpleName(), mimeTypeForAccounting, ses, destination, false);
|
accountingHandler.createFolderAddObj(uniqueName, item.getClass().getSimpleName(), mimeTypeForAccounting, ses, destination, false);
|
||||||
|
|
||||||
|
|
||||||
ses.save();
|
ses.save();
|
||||||
|
|
||||||
}finally {
|
}finally {
|
||||||
|
|
Loading…
Reference in New Issue