public interface Workspace
| Modifier and Type | Method and Description |
|---|---|
boolean |
canUserWriteIntoFolder(String folderId)
Can user write into folder.
|
void |
changeDescription(String itemId,
String newDescription)
Change an item description.
|
WorkspaceItem |
copyFile(String itemId,
String folderDestinationId)
Copy file.
|
List<WorkspaceItem> |
copyFileItems(List<String> itemIds,
String folderDestinationId)
Copy file items.
|
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.
|
URLItem |
createURL(String name,
String description,
String url,
String destinationFolderId)
Creates the URL.
|
WorkspaceVREFolder |
createVREFolder(String scope,
String description,
String displayName,
ACLType privilege)
Create a VRE folder.
|
void |
deleteItem(String itemId)
Delete item.
|
ItemStreamDescriptor |
downloadFile(String itemId,
String fileName,
String versionName,
String nodeIdsToExclude)
Download file.
|
ItemStreamDescriptor |
downloadFolder(String folderId,
String folderName,
String nodeIdsToExclude)
Download folder.
|
void |
emptyTrash()
Empty trash.
|
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<org.gcube.common.storagehub.model.items.nodes.accounting.AccountEntry> |
getAccounting(String itemId)
Gets the accounting.
|
List<? extends WorkspaceItem> |
getChildren(String id)
Gets the children.
|
long |
getDiskUsage()
Get the disk usage of a worskpace.
|
List<? extends WorkspaceItem> |
getFilteredChildren(String id,
Class<? extends org.gcube.common.storagehub.model.items.Item> aType)
Gets the filtered children.
|
PropertyMap |
getGcubeItemProperties(String gcubeItemId)
Gets the gcube item properties.
|
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.
|
List<WorkspaceFileVersion> |
getListVersionsForFile(String fileItemId)
Gets the list versions for file.
|
Map<String,Object> |
getMetadata(String itemId)
Gets the metadata.
|
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.
|
URL |
getPublicLinkForFile(String fileItemId)
Gets the public link to the latest version of file item.
|
URL |
getPublicLinkForFile(String fileItemId,
String version)
Gets the public link of the file at the input version.
|
WorkspaceFolder |
getRoot()
Returns the workspace root.
|
WorkspaceItem |
getRootSharedFolder(String itemId)
Gets the root shared folder.
|
List<String> |
getSharedFolderMembers(String folderid)
Gets the shared folder members.
|
ItemStreamDescriptor |
getThumbnailData(String itemId)
Gets the thumbnail data.
|
long |
getTotalItems()
Get the total number of items in a workspace.
|
WorkspaceItem |
getTrash()
Get Trash Folder.
|
String |
getVREFoldersId()
Gets the VRE folders id.
|
boolean |
isItemShared(String itemId)
Checks if is item shared.
|
WorkspaceItem |
moveItem(String itemId,
String destinationFolderId)
Move item.
|
List<WorkspaceItem> |
moveItems(List<String> itemIds,
String folderDestinationId)
Move items.
|
Map<String,String> |
removeItems(String... id)
Removes the items.
|
WorkspaceItem |
renameItem(String itemId,
String newName)
Rename an item.
|
WorkspaceItem |
restoreThrashItem(String itemId)
Restore thrash item.
|
List<WorkspaceItem> |
searchByMimeType(String mimeType)
Search By MimeType.
|
List<WorkspaceItem> |
searchByProperties(List<String> properties)
Search By Properties.
|
boolean |
setFolderAsPublic(String folderId,
boolean bool)
Sets the folder as public.
|
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.
|
void |
updateMetadata(String itemId,
Map<String,Object> mapObjs)
Update metadata.
|
WorkspaceItem |
uploadArchive(String folderId,
InputStream is,
String extractionFolderName)
Upload archive.
|
WorkspaceItem |
uploadFile(String folderId,
InputStream inputStream,
String fileName,
String fileDescription)
Upload file.
|
String getOwner() throws InternalErrorException, Exception
InternalErrorException - the internal error exceptionException - the exceptionWorkspaceFolder getRoot() throws InternalErrorException, Exception
InternalErrorException - the internal error exceptionException - the exceptionList<? extends WorkspaceItem> getChildren(String id) throws Exception
id - the idException - the exceptionList<? extends WorkspaceItem> getParentsById(String id) throws InternalErrorException, Exception
id - the idInternalErrorException - the internal error exceptionException - the exceptionWorkspaceItem getItem(String itemId) throws ItemNotFoundException, InternalErrorException, Exception
itemId - the item id.ItemNotFoundException - if the item has not been found.InternalErrorException - the internal error exceptionException - the exceptionWorkspaceItem getItem(String itemId, boolean withAccounting, boolean withFileDetails, boolean withMapProperties) throws ItemNotFoundException, InternalErrorException, Exception
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 exceptionException - the 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 Exception
folderId - the folder idinputStream - the input streamfileName - the file namefileDescription - the file descriptionException - the 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.WorkspaceItem getRootSharedFolder(String itemId) throws Exception
itemId - the item idException - the exceptionboolean isItemShared(String itemId) throws Exception
itemId - the item idException - the exceptionString getVREFoldersId() throws Exception
Exception - the exceptionWorkspaceItem getTrash() throws InternalErrorException, ItemNotFoundException, Exception
InternalErrorException - the internal error exceptionItemNotFoundException - the item not found exceptionException - the exceptionWorkspaceItem restoreThrashItem(String itemId) throws Exception
itemId - the item idException - the exceptionList<? extends WorkspaceItem> getFilteredChildren(String id, Class<? extends org.gcube.common.storagehub.model.items.Item> aType) throws Exception
id - the idaType - the a typeException - the exceptionWorkspaceItem renameItem(String itemId, String newName) throws ItemNotFoundException, InternalErrorException, ItemAlreadyExistException, InsufficientPrivilegesException, Exception
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 exceptionException - the exceptionURL getPublicLinkForFile(String fileItemId) throws Exception
fileItemId - the file item idException - the exceptionURL getPublicLinkForFile(String fileItemId, String version) throws Exception
fileItemId - the file item idversion - the versionException - the exceptionList<WorkspaceFileVersion> getListVersionsForFile(String fileItemId) throws Exception
fileItemId - the file item idException - the exceptionItemStreamDescriptor getThumbnailData(String itemId) throws Exception
itemId - the item idException - the exceptionMap<String,Object> getMetadata(String itemId) throws Exception
itemId - the item idException - the exceptionlong getDiskUsage()
throws Exception
Exception - the exceptionlong getTotalItems()
throws Exception
Exception - the exceptionList<org.gcube.common.storagehub.model.items.nodes.accounting.AccountEntry> getAccounting(String itemId) throws Exception
itemId - the item idException - the exceptionPropertyMap getGcubeItemProperties(String gcubeItemId) throws Exception
gcubeItemId - the gcube item idException - the exceptionvoid updateMetadata(String itemId, Map<String,Object> mapObjs) throws Exception
itemId - the item idmapObjs - the map objsException - the exceptionURLItem createURL(String name, String description, String url, String destinationFolderId) throws Exception
name - the namedescription - the descriptionurl - the urldestinationFolderId - the destination folder idException - the exceptionboolean setFolderAsPublic(String folderId, boolean bool) throws Exception
folderId - the folder idbool - the boolException - the exceptionList<WorkspaceItem> moveItems(List<String> itemIds, String folderDestinationId) throws ItemNotFoundException, WrongDestinationException, InsufficientPrivilegesException, InternalErrorException, ItemAlreadyExistException, Exception
itemIds - the item idsfolderDestinationId - the folder destination idItemNotFoundException - the item not found exceptionWrongDestinationException - the wrong destination exceptionInsufficientPrivilegesException - the insufficient privileges exceptionInternalErrorException - the internal error exceptionItemAlreadyExistException - the item already exist exceptionException - the exceptionvoid deleteItem(String itemId) throws ItemNotFoundException, InternalErrorException, InsufficientPrivilegesException, Exception
itemId - the item idItemNotFoundException - the item not found exceptionInternalErrorException - the internal error exceptionInsufficientPrivilegesException - the insufficient privileges exceptionException - the exceptionWorkspaceItem moveItem(String itemId, String destinationFolderId) throws ItemNotFoundException, WrongDestinationException, InsufficientPrivilegesException, InternalErrorException, ItemAlreadyExistException, WorkspaceFolderNotFoundException, Exception
itemId - the item iddestinationFolderId - the destination folder idItemNotFoundException - the item not found exceptionWrongDestinationException - the wrong destination exceptionInsufficientPrivilegesException - the insufficient privileges exceptionInternalErrorException - the internal error exceptionItemAlreadyExistException - the item already exist exceptionWorkspaceFolderNotFoundException - the workspace folder not found exceptionException - the exceptionWorkspaceItem copyFile(String itemId, String folderDestinationId) throws ItemNotFoundException, WrongDestinationException, InternalErrorException, ItemAlreadyExistException, InsufficientPrivilegesException, Exception
itemId - the item idfolderDestinationId - the folder destination idItemNotFoundException - the item not found exceptionWrongDestinationException - the wrong destination exceptionInternalErrorException - the internal error exceptionItemAlreadyExistException - the item already exist exceptionInsufficientPrivilegesException - the insufficient privileges exceptionException - the exceptionList<WorkspaceItem> copyFileItems(List<String> itemIds, String folderDestinationId) throws ItemNotFoundException, WrongDestinationException, InternalErrorException, ItemAlreadyExistException, InsufficientPrivilegesException, Exception
itemIds - the item idsfolderDestinationId - the folder destination idItemNotFoundException - the item not found exceptionWrongDestinationException - the wrong destination exceptionInternalErrorException - the internal error exceptionItemAlreadyExistException - the item already exist exceptionInsufficientPrivilegesException - the insufficient privileges exceptionException - the exceptionboolean canUserWriteIntoFolder(String folderId) throws Exception
folderId - the folder idException - the 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.List<WorkspaceItem> searchByMimeType(String mimeType) throws InternalErrorException
mimeType - the mime 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 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 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 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 exceptionList<WorkspaceItem> getPublicFolders() throws InternalErrorException
InternalErrorException - the internal error exceptionWorkspaceItem uploadArchive(String folderId, InputStream is, String extractionFolderName) throws Exception
folderId - the folder idis - the isextractionFolderName - the extraction folder nameException - the exceptionItemStreamDescriptor downloadFile(String itemId, String fileName, String versionName, String nodeIdsToExclude) throws Exception
itemId - the item idfileName - the file nameversionName - the version name. If is null or empty returns the latest version of filenodeIdsToExclude - the node ids to excludeException - the exceptionItemStreamDescriptor downloadFolder(String folderId, String folderName, String nodeIdsToExclude) throws Exception
folderId - the folder idfolderName - the folder namenodeIdsToExclude - the node ids to excludeException - the exceptionCopyright © 2020. All Rights Reserved.