issue on home folder removal fixed
This commit is contained in:
parent
8c677df64e
commit
7566a3cf9f
|
@ -321,15 +321,25 @@ public class UserManager {
|
|||
|
||||
try {
|
||||
Node workspaceNode = session.getNode(workspacePath.toPath());
|
||||
Node homeNode = session.getNode(homePath.toPath());
|
||||
Node trashNode = session.getNode(trashPath.toPath());
|
||||
List<Item> workspaceItems = Utils.getItemList(workspaceNode, Excludes.GET_ONLY_CONTENT, null, true, null).stream().filter(i -> !i.isShared()).collect(Collectors.toList());
|
||||
trashHandler.removeOnlyNodesContent(session, workspaceItems);
|
||||
List<Item> itemsToDelete = Utils.getItemList(trashNode, Excludes.ALL, null, true, null);
|
||||
trashHandler.removeOnlyNodesContent(session, itemsToDelete);
|
||||
} catch (PathNotFoundException e) {
|
||||
log.warn("{} workspace dir {} was already deleted", user, homePath.toPath());
|
||||
}
|
||||
|
||||
try {
|
||||
Node trashNode = session.getNode(trashPath.toPath());
|
||||
List<Item> trashItems = Utils.getItemList(trashNode, Excludes.ALL, null, true, null);
|
||||
trashHandler.removeOnlyNodesContent(session, trashItems);
|
||||
} catch (PathNotFoundException e) {
|
||||
log.warn("{} trash dir {} was already deleted", user, homePath.toPath());
|
||||
}
|
||||
|
||||
try {
|
||||
Node homeNode = session.getNode(homePath.toPath());
|
||||
homeNode.remove();
|
||||
} catch (PathNotFoundException e) {
|
||||
log.warn("{} home dir was already deleted", user);
|
||||
log.warn("{} home dir {} was already deleted", user, homePath.toPath());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -8,8 +8,6 @@ import java.util.List;
|
|||
import javax.enterprise.context.RequestScoped;
|
||||
import javax.jcr.Node;
|
||||
import javax.jcr.NodeIterator;
|
||||
import javax.jcr.Property;
|
||||
import javax.jcr.PropertyIterator;
|
||||
import javax.jcr.RepositoryException;
|
||||
import javax.jcr.Session;
|
||||
import javax.servlet.ServletContext;
|
||||
|
@ -20,18 +18,12 @@ import javax.ws.rs.Produces;
|
|||
import javax.ws.rs.QueryParam;
|
||||
import javax.ws.rs.core.Context;
|
||||
import javax.ws.rs.core.MediaType;
|
||||
import javax.ws.rs.core.Response;
|
||||
|
||||
import org.apache.jackrabbit.api.JackrabbitSession;
|
||||
import org.gcube.common.authorization.control.annotations.AuthorizationControl;
|
||||
import org.gcube.common.gxrest.response.outbound.GXOutboundErrorResponse;
|
||||
import org.gcube.common.storagehub.model.Excludes;
|
||||
import org.gcube.common.storagehub.model.exceptions.BackendGenericError;
|
||||
import org.gcube.common.storagehub.model.exceptions.StorageHubException;
|
||||
import org.gcube.common.storagehub.model.items.Item;
|
||||
import org.gcube.common.storagehub.model.service.ItemList;
|
||||
import org.gcube.data.access.storagehub.StorageHubAppllicationManager;
|
||||
import org.gcube.data.access.storagehub.Utils;
|
||||
import org.gcube.data.access.storagehub.exception.MyAuthException;
|
||||
import org.gcube.data.access.storagehub.handlers.CredentialHandler;
|
||||
import org.gcube.data.access.storagehub.services.RepositoryInitializer;
|
||||
|
|
Loading…
Reference in New Issue