public class StorageHubClientService extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
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.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.
|
List<? extends org.gcube.common.storagehub.model.items.Item> |
getChildren(String id,
boolean withAccounting,
boolean withMapProperties)
Gets the children.
|
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.
|
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.
|
List<? extends org.gcube.common.storagehub.model.items.Item> |
getParents(String itemId)
Gets the parents.
|
URL |
getPublicLinkForFile(String fileItemId)
Gets the file public link.
|
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.
|
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)
Restore thrash item.
|
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() |
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)
id - the idwithAccounting - the with accountingwithMapProperties - the with map propertiespublic 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)
id - the idaType - the a typewithAccounting - the with accountingwithMapProperties - the with map propertiespublic 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 idwithAccounting - the with accountingwithMetadata - the with metadataException - 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 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)
itemId - the item idpublic 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 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)
itemId - the item idpublic 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 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) throws Exception
itemId - the item 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 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 exceptionCopyright © 2018. All Rights Reserved.