This commit is contained in:
Lucio Lelii 2018-11-16 11:12:49 +00:00
parent 71d3dc113f
commit 05be68b220
1 changed files with 3 additions and 1 deletions

View File

@ -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);