git-svn-id: https://svn.d4science-ii.research-infrastructures.eu/gcube/branches/data-access/storagehub-webapp/1.0@180037 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
53af4bc43b
commit
0bbca46e46
2
pom.xml
2
pom.xml
|
@ -12,7 +12,7 @@
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<groupId>org.gcube.data.access</groupId>
|
<groupId>org.gcube.data.access</groupId>
|
||||||
<artifactId>storagehub</artifactId>
|
<artifactId>storagehub</artifactId>
|
||||||
<version>1.0.5-SNAPSHOT</version>
|
<version>1.0.6-SNAPSHOT</version>
|
||||||
<name>storagehub</name>
|
<name>storagehub</name>
|
||||||
|
|
||||||
<packaging>war</packaging>
|
<packaging>war</packaging>
|
||||||
|
|
|
@ -57,19 +57,18 @@ public class Node2ItemConverter {
|
||||||
public <T extends Item> T getItem(Node node, List<String> excludes) throws RepositoryException, BackendGenericError{
|
public <T extends Item> T getItem(Node node, List<String> excludes) throws RepositoryException, BackendGenericError{
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
Class<T> classToHandle = (Class<T>)ClassHandler.instance().get(node.getPrimaryNodeType().getName());
|
Class<T> classToHandle = (Class<T>)ClassHandler.instance().get(node.getPrimaryNodeType().getName());
|
||||||
Node nodeToRetrieve= node;
|
/*Node nodeToRetrieve= node;
|
||||||
if (SharedFolder.class.isAssignableFrom(classToHandle)) {
|
if (SharedFolder.class.isAssignableFrom(classToHandle)) {
|
||||||
NodeIterator it= node.getSharedSet();
|
NodeIterator it= node.getSharedSet();
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
Node sharedNode = it.nextNode();
|
Node sharedNode = it.nextNode();
|
||||||
if (sharedNode.getPath().startsWith(Utils.getWorkspacePath().toPath())) {
|
if (sharedNode.getPath().startsWith(Utils.getWorkspacePath().toPath())) {
|
||||||
nodeToRetrieve = sharedNode;
|
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.POST;
|
||||||
import javax.ws.rs.Path;
|
import javax.ws.rs.Path;
|
||||||
import javax.ws.rs.PathParam;
|
import javax.ws.rs.PathParam;
|
||||||
import javax.ws.rs.Produces;
|
|
||||||
import javax.ws.rs.core.Context;
|
import javax.ws.rs.core.Context;
|
||||||
import javax.ws.rs.core.MediaType;
|
import javax.ws.rs.core.MediaType;
|
||||||
import javax.ws.rs.core.Response;
|
import javax.ws.rs.core.Response;
|
||||||
|
@ -129,15 +128,14 @@ public class ItemsCreator {
|
||||||
|
|
||||||
authChecker.checkWriteAuthorizationControl(ses, destination.getIdentifier(), true);
|
authChecker.checkWriteAuthorizationControl(ses, destination.getIdentifier(), true);
|
||||||
|
|
||||||
//Utils.acquireLockWithWait(ses, destination.getPath(), false, login, 10);
|
Utils.acquireLockWithWait(ses, destination.getPath(), false, login, 10);
|
||||||
|
|
||||||
Node newNode;
|
Node newNode;
|
||||||
//try {
|
try {
|
||||||
newNode = Utils.createFolderInternally(ses, destination, name, description, hidden, login, accountingHandler);
|
newNode = Utils.createFolderInternally(ses, destination, name, description, hidden, login, accountingHandler);
|
||||||
ses.save();
|
ses.save();
|
||||||
/*} finally {
|
} finally {
|
||||||
ses.getWorkspace().getLockManager().unlock(destination.getPath());
|
ses.getWorkspace().getLockManager().unlock(destination.getPath());
|
||||||
}*/
|
}
|
||||||
|
|
||||||
log.info("item with id {} correctly created",newNode.getIdentifier());
|
log.info("item with id {} correctly created",newNode.getIdentifier());
|
||||||
toReturn = newNode.getIdentifier();
|
toReturn = newNode.getIdentifier();
|
||||||
|
@ -310,7 +308,7 @@ public class ItemsCreator {
|
||||||
|
|
||||||
return newNode;
|
return newNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
private AbstractFileItem fillItemWithContent(InputStream stream, String name, String description, String path, String login) throws BackendGenericError{
|
private AbstractFileItem fillItemWithContent(InputStream stream, String name, String description, String path, String login) throws BackendGenericError{
|
||||||
ContentHandler handler = getContentHandler(stream , name, path, login);
|
ContentHandler handler = getContentHandler(stream , name, path, login);
|
||||||
AbstractFileItem item =handler.buildItem(name, description, login);
|
AbstractFileItem item =handler.buildItem(name, description, login);
|
||||||
|
|
|
@ -25,7 +25,7 @@ no. 654119), SoBigData (grant no. 654024), AGINFRA PLUS (grant no. 731001).
|
||||||
Version
|
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.
|
Please see the file named "changelog.xml" in this directory for the release notes.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue