From 29b728b057949e1109f05491b7459dd8a83d513a Mon Sep 17 00:00:00 2001 From: "lucio.lelii" Date: Fri, 15 Oct 2021 12:00:09 +0200 Subject: [PATCH] reverted last commit --- .../storagehub/handlers/items/ItemHandler.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/main/java/org/gcube/data/access/storagehub/handlers/items/ItemHandler.java b/src/main/java/org/gcube/data/access/storagehub/handlers/items/ItemHandler.java index 8ccac16..9b1c82d 100644 --- a/src/main/java/org/gcube/data/access/storagehub/handlers/items/ItemHandler.java +++ b/src/main/java/org/gcube/data/access/storagehub/handlers/items/ItemHandler.java @@ -141,7 +141,7 @@ public class ItemHandler { } private Node create(FileCreationParameters params, Node destination) throws Exception{ - Node newNode = createFileItemInternally(params.getSession(), destination, params.getStream(), params.getName(), params.getDescription(), params.getUser(), true, false); + Node newNode = createFileItemInternally(params.getSession(), destination, params.getStream(), params.getName(), params.getDescription(), params.getUser(), true); params.getSession().save(); versionHandler.checkinContentNode(newNode); log.info("file with id {} correctly created",newNode.getIdentifier()); @@ -190,13 +190,13 @@ public class ItemHandler { log.debug("creating file with entire path {}, name {}, parentPath {} ", entirePath, name, parentPath); Node fileNode = null; if (parentPath.isEmpty()) - fileNode = createFileItemInternally(params.getSession(), parentDirectoryNode, input, name, "", params.getUser(), false, true); + fileNode = createFileItemInternally(params.getSession(), parentDirectoryNode, input, name, "", params.getUser(), false); else { Node parentNode = directoryNodeMap.get(parentPath); if (parentNode ==null) parentNode = createPath(parentPath, directoryNodeMap, parentDirectoryNode, params.getSession(), params.getUser()); - fileNode = createFileItemInternally(params.getSession(), parentNode, input, name, "", params.getUser(), false, true); + fileNode = createFileItemInternally(params.getSession(), parentNode, input, name, "", params.getUser(), false); } fileNodes.add(fileNode); }catch(Exception e) { @@ -246,7 +246,7 @@ public class ItemHandler { return newNode; } - private Node createFileItemInternally(Session ses, Node destinationNode, InputStream stream, String name, String description, String login, boolean withLock, boolean isBulk) throws RepositoryException, StorageHubException{ + private Node createFileItemInternally(Session ses, Node destinationNode, InputStream stream, String name, String description, String login, boolean withLock) throws RepositoryException, StorageHubException{ Node newNode; FolderItem destinationItem = node2Item.getItem(destinationNode, Excludes.ALL); @@ -281,7 +281,7 @@ public class ItemHandler { log.trace("replacing content of class {}",item.getContent().getClass()); item2Node.replaceContent(newNode,item, ItemAction.UPDATED); accountingHandler.createFileUpdated(item.getTitle(), ses, newNode, login, false); - if (!isBulk) ses.save(); + ses.save(); }finally { if (withLock) ses.getWorkspace().getLockManager().unlock(newNode.getPath()); } @@ -300,7 +300,7 @@ public class ItemHandler { try { newNode = item2Node.getNode(destinationNode, item); accountingHandler.createEntryCreate(item.getTitle(), ses, newNode, login, false); - if (!isBulk) ses.save(); + ses.save(); }finally { if (withLock) ses.getWorkspace().getLockManager().unlock(destinationNode.getPath()); }