git-svn-id: https://svn.d4science-ii.research-infrastructures.eu/gcube/branches/data-access/storagehub-webapp/1.0@178574 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
5271923cee
commit
f44f3fc0ad
2
pom.xml
2
pom.xml
|
@ -12,7 +12,7 @@
|
|||
<modelVersion>4.0.0</modelVersion>
|
||||
<groupId>org.gcube.data.access</groupId>
|
||||
<artifactId>storagehub</artifactId>
|
||||
<version>1.0.3-SNAPSHOT</version>
|
||||
<version>1.0.4-SNAPSHOT</version>
|
||||
<name>storagehub</name>
|
||||
|
||||
<packaging>war</packaging>
|
||||
|
|
|
@ -94,6 +94,7 @@ public class AccountingHandler {
|
|||
}
|
||||
if (version!=null)
|
||||
accountingNode.setProperty(VERSION_ACCOUNTING, version.getName());
|
||||
|
||||
}catch(UnsupportedRepositoryOperationException uropex) {
|
||||
logger.warn("version cannot be retrieved", uropex);
|
||||
}
|
||||
|
|
|
@ -235,23 +235,11 @@ public class ItemsCreator {
|
|||
if (!node2Item.checkNodeType(destination, FolderItem.class))
|
||||
throw new InvalidItemException("the destination item is not a folder");
|
||||
|
||||
LockManager lockManager = ses.getWorkspace().getLockManager();
|
||||
lockManager.lock(destination.getPath(), false, true, 0,login);
|
||||
|
||||
log.info("session: {}",ses.toString());
|
||||
|
||||
Node newNode;
|
||||
try {
|
||||
newNode = createFileItemInternally(ses, destination, stream, name, description, login);
|
||||
|
||||
ses.save();
|
||||
} finally {
|
||||
log.info("session: {}",ses.toString());
|
||||
try {
|
||||
lockManager.unlock(destination.getPath());
|
||||
}catch(LockException e) {
|
||||
log.warn("error unlocking item id {} with path {}",destination.getIdentifier(), destination.getPath(), e);
|
||||
}
|
||||
}
|
||||
Node newNode = createFileItemInternally(ses, destination, stream, name, description, login);
|
||||
ses.save();
|
||||
|
||||
versionHandler.checkinContentNode(newNode, ses);
|
||||
log.info("file with id {} correctly created",newNode.getIdentifier());
|
||||
|
@ -288,7 +276,7 @@ public class ItemsCreator {
|
|||
|
||||
log.debug("item prepared, fulfilling content");
|
||||
log.debug("content prepared");
|
||||
|
||||
|
||||
Node newNode;
|
||||
try {
|
||||
newNode = ses.getNode(org.gcube.common.storagehub.model.Paths.append(org.gcube.common.storagehub.model.Paths.getPath(destinationNode.getPath()), name).toPath());
|
||||
|
@ -303,7 +291,6 @@ public class ItemsCreator {
|
|||
versionHandler.makeVersionableContent(newNode, ses);
|
||||
accountingHandler.createFolderAddObj(name, item.getClass().getSimpleName(), item.getContent().getMimeType(), ses, newNode, false);
|
||||
}
|
||||
|
||||
|
||||
return newNode;
|
||||
}
|
||||
|
|
|
@ -474,6 +474,7 @@ public class ItemsManager {
|
|||
|
||||
for (Version version: jcrVersions) {
|
||||
boolean currentVersion = ((AbstractFileItem)currentItem).getContent().getStorageId().equals(version.getFrozenNode().getProperty(NodeProperty.STORAGE_ID.toString()).getString());
|
||||
|
||||
versions.add(new org.gcube.common.storagehub.model.service.Version(version.getIdentifier(), version.getName(), version.getCreated(), currentVersion));
|
||||
}
|
||||
}catch(RepositoryException re ){
|
||||
|
|
Loading…
Reference in New Issue