public interface Workspace
| Modifier and Type | Method and Description |
|---|---|
boolean |
canUserWriteIntoFolder(String folderId)
Can user write into folder.
|
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.
|
URLItem |
createURL(String name,
String description,
String url,
String destinationFolderId)
Creates the URL.
|
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 not including the ones marked as hidden.
|
List<? extends WorkspaceItem> |
getChildren(String id,
boolean includeHidden)
Gets the children including the ones marked as hidden if the bool param is true.
|
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.
|
WorkspaceItem |
getItemByPath(String idFolder,
String relativePath) |
WorkspaceItem |
getItemForExplorer(String itemId,
boolean withAccounting,
boolean withFileDetails,
boolean withMapProperties)
Gets the item for Explorer.
|
List<WorkspaceFileVersion> |
getListVersionsForFile(String fileItemId)
Gets the list versions for file.
|
Map<String,Object> |
getMetadata(String itemId)
Gets the metadata.
|
String |
getOwner()
Gets the owner.
|
List<? extends WorkspaceItem> |
getParentsById(String id)
Gets the parents by id.
|
List<? extends WorkspaceItem> |
getParentsForExplorerById(String id)
Gets the parents for explorer by id.
|
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,
String destinationFolderId)
Restore thrash item.
|
List<WorkspaceItem> |
search(String text,
String folderId)
Search.
|
void |
setFolderAsHidden(String folderId,
boolean hide)
Sets the Folder As Hidden or visible .
|
boolean |
setFolderAsPublic(String folderId,
boolean bool)
Sets the folder as public.
|
WorkspaceSharedFolder |
shareFolder(String folderId,
Set<String> users,
ACLType type) |
WorkspaceSharedFolder |
unshareFolder(String folderId,
Set<String> users) |
String |
updateDescriptionForItem(String itemId,
String newDescription)
Update description for 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> getChildren(String id, boolean includeHidden) throws Exception
id - the idhidden - true to return also the hidden onesException - 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 exceptionWorkspaceItem getItemByPath(String idFolder, String relativePath) throws ItemNotFoundException, InternalErrorException, Exception
idFolder - relativePath - ItemNotFoundException - 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, String destinationFolderId) throws Exception
itemId - the item iddestinationFolderId - the destination folder 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 exceptionList<WorkspaceItem> search(String text, String folderId) throws InternalErrorException, ItemNotFoundException, WrongItemTypeException
text - the textfolderId - the folder idInternalErrorException - the internal error exceptionItemNotFoundException - the item not found exceptionWrongItemTypeException - the wrong item type exceptionWorkspaceItem getItemForExplorer(String itemId, boolean withAccounting, boolean withFileDetails, boolean withMapProperties) throws ItemNotFoundException, InternalErrorException, Exception
itemId - the item idwithAccounting - the with accountingwithFileDetails - the with file detailswithMapProperties - the with map propertiesItemNotFoundException - the item not found exceptionInternalErrorException - the internal error exceptionException - the exceptionList<? extends WorkspaceItem> getParentsForExplorerById(String id) throws InternalErrorException, Exception
WorkspaceStorageHubClientService.getParentsById(String) except to
getRoot called inside (to check if a parent is root or not).
WorkspaceItem.isRoot() returns always false.id - the idInternalErrorException - the internal error exceptionException - 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 exceptionWorkspaceItem uploadArchive(String folderId, InputStream is, String extractionFolderName) throws Exception
folderId - the folder idis - the isextractionFolderName - the extraction folder nameException - the exceptionItemStreamDescriptor downloadFolder(String folderId, String folderName, String nodeIdsToExclude) throws Exception
folderId - the folder idfolderName - the folder namenodeIdsToExclude - the node ids to excludeException - the 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 exceptionString updateDescriptionForItem(String itemId, String newDescription) throws Exception
itemId - the item idnewDescription - the new descriptionException - the exceptionvoid setFolderAsHidden(String folderId, boolean hide) throws Exception
folderId - the folder id to set as hiddenhide - true to set hide, false to set visibleException - the exceptionWorkspaceSharedFolder shareFolder(String folderId, Set<String> users, ACLType type) throws Exception
folderId - the folder id to shareusers - the Set of users to sharetype - the permissionExceptionCopyright © 2022. All rights reserved.