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:
parent
6f5e725b0b
commit
75ca47980e
|
@ -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.
|
* Gets the root shared folder.
|
||||||
*
|
*
|
||||||
|
|
|
@ -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());
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -43,8 +43,6 @@ public enum WorkspaceItemType {
|
||||||
*/
|
*/
|
||||||
TRASH_ITEM,
|
TRASH_ITEM,
|
||||||
|
|
||||||
|
|
||||||
VRE_FOLDER;
|
VRE_FOLDER;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue