Added method isItemShared

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/Common/storagehub-client-wrapper@171538 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Francesco Mangiacrapa 2018-09-20 13:03:00 +00:00
parent 6f5e725b0b
commit 75ca47980e
3 changed files with 33 additions and 2 deletions

View File

@ -167,6 +167,20 @@ public class StorageHubClientService {
}
/**
* Checks if is item shared.
*
* @param itemId the item id
* @return true, if is item shared
* @throws Exception the exception
*/
public boolean isItemShared(String itemId) throws Exception {
setContextProviders(scope, authorizationToken);
return shcClient.open(itemId).asItem().get().isShared();
}
/**
* Gets the root shared folder.
*

View File

@ -507,6 +507,25 @@ public final class WorkspaceStorageHubClientService implements Workspace{
}
/**
* Checks if is item shared.
*
* @param itemId the item id
* @return true, if is item shared
* @throws Exception the exception
*/
public boolean isItemShared(String itemId) throws Exception {
Validate.notNull(itemId,"The input itemId is null");
try{
return storageHubClientService.isItemShared(itemId);
}catch(Exception e){
throw new Exception("Error cheking if the item is shared: "+e.getMessage());
}
}

View File

@ -43,8 +43,6 @@ public enum WorkspaceItemType {
*/
TRASH_ITEM,
VRE_FOLDER;
}