reverted last commit
This commit is contained in:
parent
7ee17adeac
commit
29b728b057
|
@ -141,7 +141,7 @@ public class ItemHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
private Node create(FileCreationParameters params, Node destination) throws Exception{
|
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();
|
params.getSession().save();
|
||||||
versionHandler.checkinContentNode(newNode);
|
versionHandler.checkinContentNode(newNode);
|
||||||
log.info("file with id {} correctly created",newNode.getIdentifier());
|
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);
|
log.debug("creating file with entire path {}, name {}, parentPath {} ", entirePath, name, parentPath);
|
||||||
Node fileNode = null;
|
Node fileNode = null;
|
||||||
if (parentPath.isEmpty())
|
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 {
|
else {
|
||||||
Node parentNode = directoryNodeMap.get(parentPath);
|
Node parentNode = directoryNodeMap.get(parentPath);
|
||||||
if (parentNode ==null)
|
if (parentNode ==null)
|
||||||
parentNode = createPath(parentPath, directoryNodeMap, parentDirectoryNode, params.getSession(), params.getUser());
|
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);
|
fileNodes.add(fileNode);
|
||||||
}catch(Exception e) {
|
}catch(Exception e) {
|
||||||
|
@ -246,7 +246,7 @@ public class ItemHandler {
|
||||||
return newNode;
|
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;
|
Node newNode;
|
||||||
FolderItem destinationItem = node2Item.getItem(destinationNode, Excludes.ALL);
|
FolderItem destinationItem = node2Item.getItem(destinationNode, Excludes.ALL);
|
||||||
|
@ -281,7 +281,7 @@ public class ItemHandler {
|
||||||
log.trace("replacing content of class {}",item.getContent().getClass());
|
log.trace("replacing content of class {}",item.getContent().getClass());
|
||||||
item2Node.replaceContent(newNode,item, ItemAction.UPDATED);
|
item2Node.replaceContent(newNode,item, ItemAction.UPDATED);
|
||||||
accountingHandler.createFileUpdated(item.getTitle(), ses, newNode, login, false);
|
accountingHandler.createFileUpdated(item.getTitle(), ses, newNode, login, false);
|
||||||
if (!isBulk) ses.save();
|
ses.save();
|
||||||
}finally {
|
}finally {
|
||||||
if (withLock) ses.getWorkspace().getLockManager().unlock(newNode.getPath());
|
if (withLock) ses.getWorkspace().getLockManager().unlock(newNode.getPath());
|
||||||
}
|
}
|
||||||
|
@ -300,7 +300,7 @@ public class ItemHandler {
|
||||||
try {
|
try {
|
||||||
newNode = item2Node.getNode(destinationNode, item);
|
newNode = item2Node.getNode(destinationNode, item);
|
||||||
accountingHandler.createEntryCreate(item.getTitle(), ses, newNode, login, false);
|
accountingHandler.createEntryCreate(item.getTitle(), ses, newNode, login, false);
|
||||||
if (!isBulk) ses.save();
|
ses.save();
|
||||||
}finally {
|
}finally {
|
||||||
if (withLock) ses.getWorkspace().getLockManager().unlock(destinationNode.getPath());
|
if (withLock) ses.getWorkspace().getLockManager().unlock(destinationNode.getPath());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue