From 2d61766e16c83f6ffd4518f29eda72be698da9ec Mon Sep 17 00:00:00 2001 From: Francesco Mangiacrapa Date: Fri, 29 Jun 2018 12:16:11 +0000 Subject: [PATCH] git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/Common/storagehub-client-wrapper@169543 82a268e6-3cf1-43bd-a215-b396298e98cf --- .../server/StorageHubClientService.java | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/src/main/java/org/gcube/common/storagehubwrapper/server/StorageHubClientService.java b/src/main/java/org/gcube/common/storagehubwrapper/server/StorageHubClientService.java index d648f4c..2c7205f 100644 --- a/src/main/java/org/gcube/common/storagehubwrapper/server/StorageHubClientService.java +++ b/src/main/java/org/gcube/common/storagehubwrapper/server/StorageHubClientService.java @@ -135,6 +135,26 @@ public class StorageHubClientService { //TODO MAP OF SHARED ROOT ID + /** + * Gets the parents. + * + * @param itemId the item id + * @return the parents + */ + public String getIdSharedFolder(String itemId) { + setContextProviders(scope, authorizationToken); + FolderContainer rootSharedFolder = shcClient.open(itemId).asItem().getRootSharedFolder(); + try{ + Validate.notNull(rootSharedFolder, "The root shared folder with id "+itemId+" does not exist"); + return rootSharedFolder.get().getId(); + }catch(Exception e){ + + } + + return null; + + } + /** * Creates the folder. *