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. *