public interface Workspace
| Modifier and Type | Method and Description |
|---|---|
void |
changeDescription(String itemId,
String newDescription)
Change an item description.
|
WorkspaceItem |
copy(String itemId,
String destinationFolderId)
Copy an item from a folder to another folder.
|
WorkspaceItem |
copy(String itemId,
String newName,
String destinationFolderId)
Copy an item from a folder to another folder.
|
URLFileItem |
createExternalUrl(String name,
String description,
InputStream url,
String destinationfolderId)
Create a new External URL into a folder.
|
URLFileItem |
createExternalUrl(String name,
String description,
String url,
String destinationFolderId)
Create a new External URL into a folder.
|
WorkspaceFolder |
createFolder(String name,
String description,
String destinationFolderId)
Create a new folder with specified name.
|
WorkspaceFolder |
createFolder(String name,
String description,
String destinationFolderId,
Map<String,String> properties)
Create a new folder with properties.
|
WorkspaceItem |
createGcubeItem(String name,
String description,
List<String> scopes,
String creator,
String itemType,
Map<String,String> properties,
String destinationFolderId)
Create a GCubeItem.
|
WorkspaceSharedFolder |
createSharedFolder(String name,
String description,
List<String> users,
String destinationFolderId)
Create a shared folder with a list of users.
|
WorkspaceSharedFolder |
createSharedFolder(String name,
String description,
String groupId,
String destinationFolderId,
String displayName,
boolean isVREFolder)
Create a shared folder associated with a groupId.
|
WorkspaceVREFolder |
createVREFolder(String scope,
String description,
String displayName,
ACLType privilege)
Create a VRE folder.
|
boolean |
exists(String name,
String folderId)
Check if an item with the specified name exists in the specified folder.
|
List<WorkspaceItem> |
find(String name,
String folderId)
Get an item with the specified name in the specified folder.
|
List<? extends WorkspaceItem> |
getChildren(String id)
Gets the children.
|
long |
getDiskUsage()
Get the disk usage of a worskpace.
|
List<WorkspaceItem> |
getFolderItems(org.gcube.common.storagehub.model.types.GenericItemType type)
Get items by type.
|
String |
getGroup(String groupId)
Get group name by group id.
|
WorkspaceItem |
getItem(String itemId)
Return the item with the specified id.
|
WorkspaceItem |
getItem(String itemId,
boolean withAccounting,
boolean withFileDetails,
boolean withMapProperties)
Return the item with the specified id.
|
WorkspaceItem |
getItemByPath(String path)
Return the item with the specified path.
|
WorkspaceFolder |
getMySpecialFolders()
Get MySpecialFolders.
|
String |
getOwner()
Gets the owner.
|
List<? extends WorkspaceItem> |
getParentsById(String id)
Gets the parents by id.
|
List<WorkspaceItem> |
getPublicFolders()
Get public folders.
|
WorkspaceFolder |
getRoot()
Returns the workspace root.
|
List<String> |
getSharedFolderMembers(String folderid)
Gets the shared folder members.
|
int |
getTotalItems()
Get the total number of items in a workspace.
|
WorkspaceTrashItem |
getTrash()
Get Trash Folder.
|
WorkspaceSharedFolder |
getVREFolderByScope(String scope)
Get VRE Folder By Scope.
|
boolean |
isGroup(String groupId)
Check if a user is a group.
|
WorkspaceItem |
moveItem(String itemId,
String destinationFolderId)
Move a workspaceItem to a specified destination.
|
void |
remove(String itemName,
String folderId)
Remove an item from a folder.
|
void |
removeItem(String itemId)
Remove an item.
|
Map<String,String> |
removeItems(String... id)
Remove a list of items identified by ids.
|
void |
renameItem(String itemId,
String newName)
Rename an item.
|
List<WorkspaceItem> |
searchByMimeType(String mimeType)
Search By MimeType.
|
List<WorkspaceItem> |
searchByName(String name,
String folderId)
Search by Name.
|
List<WorkspaceItem> |
searchByProperties(List<String> properties)
Search By Properties.
|
WorkspaceSharedFolder |
share(List<String> users,
String itemId)
Shared an exist
WorkspaceFolder with a list of users. |
WorkspaceSharedFolder |
shareFolder(List<String> users,
String destinationFolderId)
Shared an exist
WorkspaceFolder with a list of users. |
WorkspaceItem |
unshare(String itemId)
Unshare a shared item.
|
WorkspaceItem |
uploadFile(String folderId,
InputStream inputStream,
String fileName,
String fileDescription)
Upload file.
|
String getOwner() throws InternalErrorException
InternalErrorException - the internal error exceptionWorkspaceFolder getRoot() throws InternalErrorException
InternalErrorException - the internal error exceptionList<? extends WorkspaceItem> getChildren(String id)
id - the idList<? extends WorkspaceItem> getParentsById(String id) throws InternalErrorException
id - the idInternalErrorException - the internal error exceptionWorkspaceItem getItem(String itemId) throws ItemNotFoundException, InternalErrorException
itemId - the item id.ItemNotFoundException - if the item has not been found.InternalErrorException - the internal error exceptionWorkspaceItem getItem(String itemId, boolean withAccounting, boolean withFileDetails, boolean withMapProperties) throws ItemNotFoundException, InternalErrorException
itemId - the item id.withAccounting - the with accountingwithFileDetails - the with file detailswithMapProperties - the with map propertiesItemNotFoundException - if the item has not been found.InternalErrorException - the internal error exceptionWorkspaceFolder createFolder(String name, String description, String destinationFolderId) throws InternalErrorException, InsufficientPrivilegesException, ItemAlreadyExistException, WrongDestinationException, ItemNotFoundException, WorkspaceFolderNotFoundException, Exception
name - the folder name.description - the folder description.destinationFolderId - the destination folder.InternalErrorException - if an internal error occurs.InsufficientPrivilegesException - if the user don't have sufficient privileges to perform this operation.ItemAlreadyExistException - if an item with the same exist in the destination folder.WrongDestinationException - if the destination item is not a folder.ItemNotFoundException - if the destination folder has not been found.WorkspaceFolderNotFoundException - if the destination folder has not been found.Exception - the exceptionWorkspaceFolder createFolder(String name, String description, String destinationFolderId, Map<String,String> properties) throws InternalErrorException, InsufficientPrivilegesException, ItemAlreadyExistException, WrongDestinationException, ItemNotFoundException, WorkspaceFolderNotFoundException
name - the namedescription - the descriptiondestinationFolderId - the destination folder idproperties - the propertiesInternalErrorException - the internal error exceptionInsufficientPrivilegesException - the insufficient privileges exceptionItemAlreadyExistException - the item already exist exceptionWrongDestinationException - the wrong destination exceptionItemNotFoundException - the item not found exceptionWorkspaceFolderNotFoundException - the workspace folder not found exceptionWorkspaceItem uploadFile(String folderId, InputStream inputStream, String fileName, String fileDescription) throws InsufficientPrivilegesException, WorkspaceFolderNotFoundException, InternalErrorException, ItemAlreadyExistException, WrongDestinationException
folderId - the folder idinputStream - the input streamfileName - the file namefileDescription - the file descriptionInsufficientPrivilegesException - the insufficient privileges exceptionWorkspaceFolderNotFoundException - the workspace folder not found exceptionInternalErrorException - the internal error exceptionItemAlreadyExistException - the item already exist exceptionWrongDestinationException - the wrong destination exceptionList<String> getSharedFolderMembers(String folderid) throws Exception
folderid - the folderidException - the exceptionboolean exists(String name, String folderId) throws InternalErrorException, ItemNotFoundException, WrongItemTypeException
name - the name to check.folderId - the folder where to search the item.true if the item exists, false otherwise.InternalErrorException - if an error occurs.ItemNotFoundException - if the folder has not been found.WrongItemTypeException - if the folderId referrer to an item with type different from Workspace or folder.List<WorkspaceItem> find(String name, String folderId) throws InternalErrorException, ItemNotFoundException, WrongItemTypeException
name - the item name to find.folderId - the folder where to search the item.null otherwise.InternalErrorException - if an error occurs.ItemNotFoundException - if the folder has not been found.WrongItemTypeException - if the folderId referrer to an item with type different from Workspace or folder.URLFileItem createExternalUrl(String name, String description, String url, String destinationFolderId) throws InsufficientPrivilegesException, WorkspaceFolderNotFoundException, InternalErrorException, ItemAlreadyExistException, WrongDestinationException, IOException
name - the external URL name.description - the external URL description.url - the external URL value.destinationFolderId - the destination folder.InsufficientPrivilegesException - if the user don't have sufficient privileges to perform this operation.WorkspaceFolderNotFoundException - if the destination folder has not been found.InternalErrorException - if an internal error occurs.ItemAlreadyExistException - if a folder item with same name already exist.WrongDestinationException - if the destination type is not a folder.IOException - Signals that an I/O exception has occurred.URLFileItem createExternalUrl(String name, String description, InputStream url, String destinationfolderId) throws InsufficientPrivilegesException, InternalErrorException, ItemAlreadyExistException, WrongDestinationException, WorkspaceFolderNotFoundException, IOException
name - the external URL name.description - the external URL description.url - the external URL.destinationfolderId - the destination folder.InsufficientPrivilegesException - if the user don't have sufficient privileges to perform this operation.WorkspaceFolderNotFoundException - if the destination folder has not been found.InternalErrorException - if an internal error occurs.ItemAlreadyExistException - if a folder item with same name already exist.WrongDestinationException - if the destination type is not a folder.IOExceptionvoid removeItem(String itemId) throws ItemNotFoundException, InternalErrorException, InsufficientPrivilegesException
itemId - the item to remove.ItemNotFoundException - if the item has not been found.InternalErrorException - if an internal error occurs.InsufficientPrivilegesException - if the user don't have sufficient privileges to perform this operation.WorkspaceItem moveItem(String itemId, String destinationFolderId) throws ItemNotFoundException, WrongDestinationException, InsufficientPrivilegesException, InternalErrorException, ItemAlreadyExistException, WorkspaceFolderNotFoundException
itemId - the item to move.destinationFolderId - the destination folder.ItemNotFoundException - if the specified item has not been found.WrongDestinationException - if the specified destination has not been found.InsufficientPrivilegesException - if the user don't have sufficient privileges to perform this operation.InternalErrorException - if an internal error occurs.ItemAlreadyExistException - if the destination folder have a children with same name.WorkspaceFolderNotFoundException - if the destination folder is not found.void renameItem(String itemId, String newName) throws ItemNotFoundException, InternalErrorException, ItemAlreadyExistException, InsufficientPrivilegesException
itemId - the item id.newName - the new name.ItemNotFoundException - if the item has not been found.InternalErrorException - if an internal error occurs.ItemAlreadyExistException - if the user don't have sufficient privileges to perform this operation.InsufficientPrivilegesException - the insufficient privileges exceptionvoid changeDescription(String itemId, String newDescription) throws ItemNotFoundException, InternalErrorException
itemId - the item to update.newDescription - the new item description.ItemNotFoundException - if the item has not been found.InternalErrorException - if an internal error occurs.WorkspaceItem getItemByPath(String path) throws ItemNotFoundException
path - the item path.ItemNotFoundException - if the item has not been found.void remove(String itemName, String folderId) throws ItemNotFoundException, InternalErrorException, InsufficientPrivilegesException, WrongItemTypeException
itemName - the item name.folderId - the folder id.ItemNotFoundException - if the folder has not been found.InternalErrorException - if an internal error occurs.InsufficientPrivilegesException - if the user don't have sufficient privileges to perform this operation.WrongItemTypeException - if the specified folder is neither a workspace nor a folder.WorkspaceItem copy(String itemId, String newName, String destinationFolderId) throws ItemNotFoundException, WrongDestinationException, InternalErrorException, ItemAlreadyExistException, InsufficientPrivilegesException, WorkspaceFolderNotFoundException
itemId - the item to copy.newName - the item new name.destinationFolderId - the destination folder id.ItemNotFoundException - if the item has not been found.WrongDestinationException - if the destination have a wrong type.InternalErrorException - if an internal error occurs.ItemAlreadyExistException - if an item with same name already exist in the destination folder.InsufficientPrivilegesException - if the user don't have sufficient privileges to perform this operation.WorkspaceFolderNotFoundException - if the destination folder has not been found.WorkspaceItem copy(String itemId, String destinationFolderId) throws ItemNotFoundException, WrongDestinationException, InternalErrorException, ItemAlreadyExistException, InsufficientPrivilegesException, WorkspaceFolderNotFoundException
itemId - the item to copy.destinationFolderId - the destination folder id, can't be the same of the item (can't have the same name).ItemNotFoundException - if the item has not been found.WrongDestinationException - if the destination have a wrong type.InternalErrorException - if an internal error occurs.ItemAlreadyExistException - if an item with same name already exist in the destination folder.InsufficientPrivilegesException - if the user don't have sufficient privileges to perform this operation.WorkspaceFolderNotFoundException - if the destination folder has not been found.List<WorkspaceItem> searchByName(String name, String folderId) throws InternalErrorException
name - the namefolderId - the folder idInternalErrorException - the internal error exceptionList<WorkspaceItem> searchByMimeType(String mimeType) throws InternalErrorException
mimeType - the mime typeInternalErrorException - the internal error exceptionList<WorkspaceItem> getFolderItems(org.gcube.common.storagehub.model.types.GenericItemType type) throws InternalErrorException
type - the typeInternalErrorException - the internal error exceptionWorkspaceSharedFolder createSharedFolder(String name, String description, List<String> users, String destinationFolderId) throws InternalErrorException, InsufficientPrivilegesException, ItemAlreadyExistException, WrongDestinationException, ItemNotFoundException, WorkspaceFolderNotFoundException
name - the namedescription - the descriptionusers - A list of portal loginsdestinationFolderId - the destination folder idInternalErrorException - the internal error exceptionInsufficientPrivilegesException - the insufficient privileges exceptionItemAlreadyExistException - the item already exist exceptionWrongDestinationException - the wrong destination exceptionItemNotFoundException - the item not found exceptionWorkspaceFolderNotFoundException - the workspace folder not found exceptionWorkspaceSharedFolder createSharedFolder(String name, String description, String groupId, String destinationFolderId, String displayName, boolean isVREFolder) throws InternalErrorException, InsufficientPrivilegesException, ItemAlreadyExistException, WrongDestinationException, ItemNotFoundException, WorkspaceFolderNotFoundException
name - the name of the folderdescription - the descriptiongroupId - an existing groupId to associate with the folderdestinationFolderId - the destination folder iddisplayName - a friendly name for the folderisVREFolder - a flag to indicate the folder is a VRE FolderInternalErrorException - the internal error exceptionInsufficientPrivilegesException - the insufficient privileges exceptionItemAlreadyExistException - the item already exist exceptionWrongDestinationException - the wrong destination exceptionItemNotFoundException - the item not found exceptionWorkspaceFolderNotFoundException - the workspace folder not found exceptionWorkspaceSharedFolder shareFolder(List<String> users, String destinationFolderId) throws InternalErrorException, InsufficientPrivilegesException, ItemAlreadyExistException, WrongDestinationException, ItemNotFoundException, WorkspaceFolderNotFoundException
WorkspaceFolder with a list of users.users - A list of portal logins.destinationFolderId - the destination folder idInternalErrorException - the internal error exceptionInsufficientPrivilegesException - the insufficient privileges exceptionItemAlreadyExistException - the item already exist exceptionWrongDestinationException - the wrong destination exceptionItemNotFoundException - the item not found exceptionWorkspaceFolderNotFoundException - the workspace folder not found exceptionWorkspaceSharedFolder share(List<String> users, String itemId) throws InternalErrorException, InsufficientPrivilegesException, ItemAlreadyExistException, WrongDestinationException, ItemNotFoundException, WorkspaceFolderNotFoundException
WorkspaceFolder with a list of users.users - A list of portal logins.itemId - the item idInternalErrorException - the internal error exceptionInsufficientPrivilegesException - the insufficient privileges exceptionItemAlreadyExistException - the item already exist exceptionWrongDestinationException - the wrong destination exceptionItemNotFoundException - the item not found exceptionWorkspaceFolderNotFoundException - the workspace folder not found exceptionWorkspaceItem createGcubeItem(String name, String description, List<String> scopes, String creator, String itemType, Map<String,String> properties, String destinationFolderId) throws InsufficientPrivilegesException, WorkspaceFolderNotFoundException, InternalErrorException, ItemAlreadyExistException, WrongDestinationException, ItemNotFoundException
name - the namedescription - the descriptionscopes - the scopescreator - the creatoritemType - the item typeproperties - the propertiesdestinationFolderId - the destination folder idInsufficientPrivilegesException - the insufficient privileges exceptionWorkspaceFolderNotFoundException - the workspace folder not found exceptionInternalErrorException - the internal error exceptionItemAlreadyExistException - the item already exist exceptionWrongDestinationException - the wrong destination exceptionItemNotFoundException - the item not found exceptionWorkspaceItem unshare(String itemId) throws InternalErrorException, ItemNotFoundException
itemId - the item idInternalErrorException - the internal error exceptionItemNotFoundException - the item not found exceptionWorkspaceTrashItem getTrash() throws InternalErrorException, ItemNotFoundException
InternalErrorException - the internal error exceptionItemNotFoundException - the item not found exceptionWorkspaceFolder getMySpecialFolders() throws InternalErrorException, ItemNotFoundException
InternalErrorException - the internal error exceptionItemNotFoundException - the item not found exceptionList<WorkspaceItem> searchByProperties(List<String> properties) throws InternalErrorException
properties - the propertiesInternalErrorException - the internal error exceptionWorkspaceSharedFolder getVREFolderByScope(String scope) throws ItemNotFoundException, InternalErrorException
scope - the scopeItemNotFoundException - the item not found exceptionInternalErrorException - the internal error exceptionlong getDiskUsage()
throws InternalErrorException
InternalErrorException - the internal error exceptionint getTotalItems()
throws InternalErrorException
InternalErrorException - the internal error exceptionMap<String,String> removeItems(String... id) throws ItemNotFoundException, InternalErrorException, InsufficientPrivilegesException
id - the idItemNotFoundException - the item not found exceptionInternalErrorException - the internal error exceptionInsufficientPrivilegesException - the insufficient privileges exceptionWorkspaceVREFolder createVREFolder(String scope, String description, String displayName, ACLType privilege) throws InternalErrorException, InsufficientPrivilegesException, ItemAlreadyExistException, WrongDestinationException, ItemNotFoundException, WorkspaceFolderNotFoundException
scope - the scopedescription - the descriptiondisplayName - the display nameprivilege - the privilegeInternalErrorException - the internal error exceptionInsufficientPrivilegesException - the insufficient privileges exceptionItemAlreadyExistException - the item already exist exceptionWrongDestinationException - the wrong destination exceptionItemNotFoundException - the item not found exceptionWorkspaceFolderNotFoundException - the workspace folder not found exceptionString getGroup(String groupId) throws InternalErrorException
groupId - the group idInternalErrorException - the internal error exceptionboolean isGroup(String groupId) throws InternalErrorException
groupId - the group idInternalErrorException - the internal error exceptionList<WorkspaceItem> getPublicFolders() throws InternalErrorException
InternalErrorException - the internal error exceptionCopyright © 2018. All Rights Reserved.