public class StorageHubClientService extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
ACCOUNTING_HL_NODE_NAME
The Constant ACCOUNTING_HL_NODE_NAME.
|
| Constructor and Description |
|---|
StorageHubClientService(String scope,
String authorizationToken)
Instantiates a new storage hub service util.
|
| Modifier and Type | Method and Description |
|---|---|
org.gcube.common.storagehub.model.items.ExternalLink |
addURL(String folderId,
URL URL,
String name,
String description)
Adds the URL.
|
boolean |
canWrite(String folderContainerId)
Can write.
|
org.gcube.common.storagehub.model.items.AbstractFileItem |
copyFileItem(String fileItemId,
org.gcube.common.storagehub.client.dsl.FolderContainer destFolderContainer,
String newFileName)
Copy item.
|
org.gcube.common.storagehub.model.items.Item |
createFolder(String parentId,
String folderName,
String folderDescription)
Creates the folder.
|
void |
deleteItemById(String itemId)
Delete item by id.
|
org.gcube.common.storagehub.client.StreamDescriptor |
downloadFile(String itemId,
String versionName,
String... nodeIdsToExclude)
Download file.
|
org.gcube.common.storagehub.client.StreamDescriptor |
downloadFolder(String folderId,
String nodeIdsToExclude)
Download folder.
|
void |
emptyTrash()
Empty trash.
|
List<? extends org.gcube.common.storagehub.model.items.Item> |
findByName(String name,
String folderId)
Find by name.
|
org.gcube.common.storagehub.model.items.nodes.Accounting |
getAccounting(String itemId)
Gets the accounting.
|
List<? extends org.gcube.common.storagehub.model.items.Item> |
getChildren(String id,
boolean withAccounting,
boolean withMapProperties)
Gets the children.
|
long |
getDiskUsage()
Gets the disk usage.
|
List<? extends org.gcube.common.storagehub.model.items.Item> |
getFilteredChildren(String id,
Class<? extends org.gcube.common.storagehub.model.items.Item> aType,
boolean withAccounting,
boolean withMapProperties)
Gets the filtered children.
|
org.gcube.common.storagehub.client.dsl.FolderContainer |
getFolderContainer(String itemId)
Gets the folder container.
|
org.gcube.common.storagehub.model.Metadata |
getGcubeItemProperties(String gcubeItemId)
Gets the gcube item properties.
|
String |
getIdSharedFolder(String itemId)
Gets the id shared folder.
|
org.gcube.common.storagehub.model.items.nodes.ImageContent |
getImageContent(String itemId)
Gets the image content.
|
org.gcube.common.storagehub.model.items.Item |
getItem(String itemId)
Gets the item.
|
org.gcube.common.storagehub.model.items.Item |
getItem(String itemId,
boolean withAccounting,
boolean withMetadata)
Gets the item.
|
int |
getItemChildrenCount(String itemId)
Gets the item children count.
|
List<org.gcube.common.storagehub.model.service.Version> |
getListVersions(String fileItemId)
Gets the list versions.
|
Map<String,Object> |
getMetadata(String itemId)
Gets the metadata.
|
List<? extends org.gcube.common.storagehub.model.items.Item> |
getParents(String itemId)
Gets the parents.
|
URL |
getPublicLinkForFile(String fileItemId)
Gets the file public link.
|
URL |
getPublicLinkForFileVersion(String fileItemId,
String version)
Gets the public link for file version.
|
org.gcube.common.storagehub.model.items.FolderItem |
getRoot()
Gets the root.
|
org.gcube.common.storagehub.model.items.FolderItem |
getRootSharedFolder(org.gcube.common.storagehub.client.dsl.ItemContainer<org.gcube.common.storagehub.model.items.Item> itemContainer)
Gets the root shared folder.
|
org.gcube.common.storagehub.model.items.FolderItem |
getRootSharedFolder(String itemId)
Gets the root shared folder.
|
List<String> |
getSharedFolderMembers(String folderId)
Gets the shared folder members.
|
long |
getTotalItems()
Gets the total items.
|
org.gcube.common.storagehub.model.items.Item |
getTrash()
Gets the root.
|
String |
getUserACLForFolderId(String infrastructureName,
String userName,
String folderId)
Gets the user acl for folder id.
|
String |
getVREFoldersId()
Gets the VRE folders id.
|
boolean |
isItemShared(String itemId)
Checks if is item shared.
|
org.gcube.common.storagehub.model.items.Item |
moveItem(String itemId,
org.gcube.common.storagehub.client.dsl.FolderContainer destFolderContainer)
Move item.
|
org.gcube.common.storagehub.model.items.Item |
openTrash()
Open trash.
|
org.gcube.common.storagehub.model.items.Item |
renameItem(String itemId,
String newName)
Rename item.
|
org.gcube.common.storagehub.model.items.Item |
restoreThrashItem(String itemId,
String destinationFolderId)
Restore thrash item.
|
List<? extends org.gcube.common.storagehub.model.items.Item> |
searchForText(String text,
String folderId)
Search for text.
|
boolean |
setFolderAsPublic(String folderId,
boolean setPublic)
Sets the folder as public.
|
void |
setMetadata(String itemId,
Map<String,Object> mapProperties)
Sets the metadata.
|
org.gcube.common.storagehub.model.items.Item |
setMetadata(String itemId,
org.gcube.common.storagehub.model.Metadata metadata)
Sets the metadata and returns the Item with metadata updated.
|
String |
toString()
To string.
|
String |
updateDescriptionForItem(String itemId,
String newDescription)
Update description for item.
|
org.gcube.common.storagehub.model.items.Item |
uploadArchive(String folderId,
InputStream is,
String extractionFolderName)
Upload archive.
|
org.gcube.common.storagehub.model.items.Item |
uploadFile(String folderId,
InputStream is,
String fileName,
String fileDescription)
Upload file.
|
public static final String ACCOUNTING_HL_NODE_NAME
public org.gcube.common.storagehub.model.items.FolderItem getRoot()
throws Exception
Exception - the exceptionpublic org.gcube.common.storagehub.model.items.Item getTrash()
public List<? extends org.gcube.common.storagehub.model.items.Item> getChildren(String id, boolean withAccounting, boolean withMapProperties) throws Exception
id - the idwithAccounting - the with accountingwithMapProperties - the with map propertiesException - the exceptionpublic List<? extends org.gcube.common.storagehub.model.items.Item> getFilteredChildren(String id, Class<? extends org.gcube.common.storagehub.model.items.Item> aType, boolean withAccounting, boolean withMapProperties) throws Exception
id - the idaType - the a typewithAccounting - the with accountingwithMapProperties - the with map propertiesException - the exceptionpublic org.gcube.common.storagehub.model.items.Item getItem(String itemId, boolean withAccounting, boolean withMetadata) throws Exception
itemId - the item idwithAccounting - the with accountingwithMetadata - the with metadataException - the exceptionpublic org.gcube.common.storagehub.model.items.Item getItem(String itemId) throws Exception
itemId - the item idException - the exceptionpublic org.gcube.common.storagehub.model.items.Item setMetadata(String itemId, org.gcube.common.storagehub.model.Metadata metadata) throws Exception
itemId - the item idmetadata - the metadataException - the exceptionpublic Map<String,Object> getMetadata(String itemId) throws Exception
itemId - the item idException - the exceptionpublic org.gcube.common.storagehub.client.dsl.FolderContainer getFolderContainer(String itemId) throws Exception
itemId - the item idException - the exceptionpublic List<? extends org.gcube.common.storagehub.model.items.Item> getParents(String itemId) throws Exception
itemId - the item idException - the exceptionpublic String getIdSharedFolder(String itemId) throws Exception
itemId - the item idException - the exceptionpublic org.gcube.common.storagehub.model.items.FolderItem getRootSharedFolder(String itemId) throws Exception
itemId - the item idException - the exceptionpublic boolean isItemShared(String itemId) throws Exception
itemId - the item idException - the exceptionpublic boolean canWrite(String folderContainerId) throws Exception
folderContainerId - the folder container idException - the exceptionpublic org.gcube.common.storagehub.model.items.FolderItem getRootSharedFolder(org.gcube.common.storagehub.client.dsl.ItemContainer<org.gcube.common.storagehub.model.items.Item> itemContainer)
throws Exception
itemContainer - the item containerException - the exceptionpublic org.gcube.common.storagehub.model.items.Item createFolder(String parentId, String folderName, String folderDescription) throws Exception
parentId - the parent idfolderName - the folder namefolderDescription - the folder descriptionException - the exceptionpublic String getVREFoldersId()
public String getUserACLForFolderId(String infrastructureName, String userName, String folderId) throws Exception
infrastructureName - the infrastructure nameuserName - the user namefolderId - the folder idException - the exceptionpublic int getItemChildrenCount(String itemId) throws Exception
itemId - the item idException - the exceptionpublic org.gcube.common.storagehub.model.items.Item uploadFile(String folderId, InputStream is, String fileName, String fileDescription) throws Exception
folderId - the folder idis - the isfileName - the file namefileDescription - the file descriptionException - the exceptionpublic org.gcube.common.storagehub.client.StreamDescriptor downloadFile(String itemId, String versionName, String... nodeIdsToExclude) throws Exception
itemId - the item idversionName - the version name. If is null or empty returns the latest version of filenodeIdsToExclude - the node ids to excludeException - the exceptionpublic org.gcube.common.storagehub.client.StreamDescriptor downloadFolder(String folderId, String nodeIdsToExclude) throws Exception
folderId - the folder idnodeIdsToExclude - the node ids to excludeException - the exceptionpublic org.gcube.common.storagehub.model.items.Item uploadArchive(String folderId, InputStream is, String extractionFolderName) throws Exception
folderId - the folder idis - the isextractionFolderName - the extraction folder nameException - the exceptionpublic List<String> getSharedFolderMembers(String folderId) throws Exception
folderId - the folder idException - the exceptionpublic List<? extends org.gcube.common.storagehub.model.items.Item> findByName(String name, String folderId) throws Exception
name - the namefolderId - the folder idException - the exceptionpublic List<? extends org.gcube.common.storagehub.model.items.Item> searchForText(String text, String folderId) throws Exception
text - the textfolderId - the folder idException - the exceptionpublic void deleteItemById(String itemId) throws Exception
itemId - the item idException - the exceptionpublic org.gcube.common.storagehub.model.items.Item openTrash()
throws Exception
Exception - the exceptionpublic org.gcube.common.storagehub.model.items.Item restoreThrashItem(String itemId, String destinationFolderId) throws Exception
itemId - the item iddestinationFolderId - the destination folder idException - the exceptionpublic org.gcube.common.storagehub.model.items.Item moveItem(String itemId, org.gcube.common.storagehub.client.dsl.FolderContainer destFolderContainer) throws Exception
itemId - the item iddestFolderContainer - the dest folder containerException - the exceptionpublic org.gcube.common.storagehub.model.items.AbstractFileItem copyFileItem(String fileItemId, org.gcube.common.storagehub.client.dsl.FolderContainer destFolderContainer, String newFileName) throws Exception
fileItemId - the copy item iddestFolderContainer - the dest folder containernewFileName - the new file nameException - the exceptionpublic org.gcube.common.storagehub.model.items.Item renameItem(String itemId, String newName) throws Exception
itemId - the item idnewName - the new nameException - the exceptionpublic URL getPublicLinkForFile(String fileItemId) throws Exception
fileItemId - the file item idException - the exceptionpublic URL getPublicLinkForFileVersion(String fileItemId, String version) throws Exception
fileItemId - the file item idversion - the versionException - the exceptionpublic List<org.gcube.common.storagehub.model.service.Version> getListVersions(String fileItemId) throws Exception
fileItemId - the file item idException - the exceptionpublic org.gcube.common.storagehub.model.items.nodes.ImageContent getImageContent(String itemId) throws Exception
itemId - the item idException - the exceptionpublic long getTotalItems()
throws Exception
Exception - the exceptionpublic long getDiskUsage()
throws Exception
Exception - the exceptionpublic org.gcube.common.storagehub.model.items.nodes.Accounting getAccounting(String itemId) throws Exception
itemId - the item idException - the exceptionpublic org.gcube.common.storagehub.model.Metadata getGcubeItemProperties(String gcubeItemId) throws Exception
gcubeItemId - the gcube item idException - the exceptionpublic void setMetadata(String itemId, Map<String,Object> mapProperties) throws Exception
itemId - the item idmapProperties - the map propertiesException - the exceptionpublic org.gcube.common.storagehub.model.items.ExternalLink addURL(String folderId, URL URL, String name, String description) throws org.gcube.common.storagehub.model.exceptions.StorageHubException
folderId - the folder idURL - the urlname - the namedescription - the descriptionorg.gcube.common.storagehub.model.exceptions.StorageHubException - the storage hub exceptionpublic boolean setFolderAsPublic(String folderId, boolean setPublic) throws Exception
folderId - the folder idsetPublic - the set publicException - the exceptionpublic String updateDescriptionForItem(String itemId, String newDescription) throws Exception
itemId - the item idnewDescription - the new descriptionException - the exceptionCopyright © 2021. All Rights Reserved.