Lucio Lelii 5 years ago
parent 53af4bc43b
commit 0bbca46e46

@ -12,7 +12,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.gcube.data.access</groupId>
<artifactId>storagehub</artifactId>
<version>1.0.5-SNAPSHOT</version>
<version>1.0.6-SNAPSHOT</version>
<name>storagehub</name>
<packaging>war</packaging>

@ -57,19 +57,18 @@ public class Node2ItemConverter {
public <T extends Item> T getItem(Node node, List<String> excludes) throws RepositoryException, BackendGenericError{
@SuppressWarnings("unchecked")
Class<T> classToHandle = (Class<T>)ClassHandler.instance().get(node.getPrimaryNodeType().getName());
Node nodeToRetrieve= node;
/*Node nodeToRetrieve= node;
if (SharedFolder.class.isAssignableFrom(classToHandle)) {
NodeIterator it= node.getSharedSet();
while (it.hasNext()) {
Node sharedNode = it.nextNode();
if (sharedNode.getPath().startsWith(Utils.getWorkspacePath().toPath())) {
nodeToRetrieve = sharedNode;
break;
}
}
}
return retrieveItem(nodeToRetrieve, excludes, classToHandle);
}*/
return retrieveItem(node, excludes, classToHandle);
}

@ -25,7 +25,6 @@ import javax.ws.rs.FormParam;
import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
import javax.ws.rs.core.Context;
import javax.ws.rs.core.MediaType;
import javax.ws.rs.core.Response;
@ -129,15 +128,14 @@ public class ItemsCreator {
authChecker.checkWriteAuthorizationControl(ses, destination.getIdentifier(), true);
//Utils.acquireLockWithWait(ses, destination.getPath(), false, login, 10);
Utils.acquireLockWithWait(ses, destination.getPath(), false, login, 10);
Node newNode;
//try {
newNode = Utils.createFolderInternally(ses, destination, name, description, hidden, login, accountingHandler);
ses.save();
/*} finally {
try {
newNode = Utils.createFolderInternally(ses, destination, name, description, hidden, login, accountingHandler);
ses.save();
} finally {
ses.getWorkspace().getLockManager().unlock(destination.getPath());
}*/
}
log.info("item with id {} correctly created",newNode.getIdentifier());
toReturn = newNode.getIdentifier();
@ -310,7 +308,7 @@ public class ItemsCreator {
return newNode;
}
private AbstractFileItem fillItemWithContent(InputStream stream, String name, String description, String path, String login) throws BackendGenericError{
ContentHandler handler = getContentHandler(stream , name, path, login);
AbstractFileItem item =handler.buildItem(name, description, login);

@ -25,7 +25,7 @@ no. 654119), SoBigData (grant no. 654024), AGINFRA PLUS (grant no. 731001).
Version
--------------------------------------------------
1.0.5-SNAPSHOT (2019-05-29)
1.0.5-SNAPSHOT (2019-06-27)
Please see the file named "changelog.xml" in this directory for the release notes.

Loading…
Cancel
Save