This commit is contained in:
Lucio Lelii 2019-01-18 14:03:10 +00:00
parent 5ed8bb43e4
commit 042ecafe50
1 changed files with 6 additions and 2 deletions

View File

@ -207,14 +207,18 @@ public class WorkspaceManager {
public ItemWrapper<Item> getTrashRootFolder(){
InnerMethodName.instance.set("getTrashRootFolder");
Session ses = null;
String user = AuthorizationProvider.instance.get().getClient().getId();
org.gcube.common.storagehub.model.Path trashPath = Paths.append(Utils.getWorkspacePath(), Constants.TRASH_ROOT_FOLDER_NAME);
Item item = null;
try{
long start = System.currentTimeMillis();
ses = repository.getRepository().login(CredentialHandler.getAdminCredentials(context));
log.info("time to connect to repo {}",(System.currentTimeMillis()-start));
if (!ses.nodeExists(trashPath.toPath())) {
Utils.createFolderInternally(ses, ses.getNode(Utils.getWorkspacePath().toPath()) , Constants.TRASH_ROOT_FOLDER_NAME, "trash of "+user, false, user, null);
}
Node folder = ses.getNode(trashPath.toPath());
item = node2Item.getItem(folder, excludes);
}catch(RepositoryException re ){