|
|
|
@ -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);
|
|
|
|
|