NodeAdmin resource added

This commit is contained in:
lucio.lelii 2021-03-16 10:01:07 +01:00
parent 61c84fbb11
commit 8c677df64e
3 changed files with 4 additions and 1 deletions

View File

@ -15,6 +15,7 @@ import org.gcube.data.access.storagehub.services.ItemsManager;
import org.gcube.data.access.storagehub.services.UserManager;
import org.gcube.data.access.storagehub.services.WorkspaceManager;
import org.gcube.data.access.storagehub.services.admin.ItemManagerAdmin;
import org.gcube.data.access.storagehub.services.admin.NodeManagerAdmin;
import org.glassfish.jersey.media.multipart.MultiPartFeature;
@Path("workspace")
@ -33,6 +34,7 @@ public class StorageHub extends Application {
classes.add(UserManager.class);
classes.add(GroupManager.class);
classes.add(ItemManagerAdmin.class);
classes.add(NodeManagerAdmin.class);
classes.add(SerializableErrorEntityTextWriter.class);
classes.add(MyApplicationListener.class);
return classes;

View File

@ -315,6 +315,7 @@ public class Utils {
idsToDelete.add(((AbstractFileItem) itemToDelete).getContent().getStorageId());
}else if (itemToDelete instanceof FolderItem) {
//only to be sure to not delete shared content
if (itemToDelete.isShared()) return;
List<Item> items = Utils.getItemList(ses.getNodeByIdentifier(itemToDelete.getId()), Excludes.GET_ONLY_CONTENT , null, true, null);
for (Item item: items)

View File

@ -197,7 +197,7 @@ public class GroupManager {
try {
Node node = groupHandler.getVreFolderNode(session, group);
List<Item> workspaceItems = Utils.getItemList(node, Excludes.GET_ONLY_CONTENT, null, true, null);
trashHandler.removeNodes(session, workspaceItems);
trashHandler.removeOnlyNodesContent(session, workspaceItems);
node.removeSharedSet();
}catch (Exception e) {
log.warn("vreFolder {} not found, removing only the group", group);