Package org.gcube.storagehub
Class StorageHubManagement
java.lang.Object
org.gcube.storagehub.StorageHubManagement
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringprotected MetadataMatcherprotected Stringprotected org.gcube.common.storagehub.client.dsl.FileContainerprotected final org.gcube.common.storagehub.client.dsl.StorageHubClient -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionorg.gcube.common.storagehub.client.dsl.FolderContainerprotected org.gcube.common.storagehub.client.dsl.FolderContainerorg.gcube.common.storagehub.client.dsl.FolderContainergetDestinationFolder(String mimeType) org.gcube.common.storagehub.client.dsl.FileContainergetFileContainer(URL shubPublicLink) static Stringprotected org.gcube.common.storagehub.client.dsl.FolderContainergetOrCreateFolder(org.gcube.common.storagehub.client.dsl.FolderContainer parent, String name, String description, boolean hidden) org.gcube.common.storagehub.client.dsl.FileContainerorg.gcube.common.storagehub.client.dsl.FileContainergetPersistedFile(String filename, String mimeType) static StringgetPublicLinkID(URL url) org.gcube.common.storagehub.client.dsl.StorageHubClientprotected org.gcube.common.storagehub.client.dsl.FolderContainerprotected booleanisPersistedFile(org.gcube.common.storagehub.client.dsl.FileContainer fileContainer, String filename) protected voidlogItem(org.gcube.common.storagehub.client.dsl.ItemContainer<? extends org.gcube.common.storagehub.model.items.Item> itemContainer) protected voidlogItem(org.gcube.common.storagehub.client.dsl.ItemContainer<? extends org.gcube.common.storagehub.model.items.Item> itemContainer, int level) persistFile(InputStream inputStream, String fileName, String mimeType) persistFile(URL shubPublicLink, String fileName, String mimeType) This method can be used only if the caller has the right to access the file already stored in the workspaceprotected voidrecursiveList(org.gcube.common.storagehub.client.dsl.FolderContainer folder, int level) voidremovePersistedFile(String filename, String mimeType) Deprecated.voidremovePersistedFile(URL shubPublicLink) The caller must have the rights to access the file pointed to the public linkvoidsetMetadataMatcher(MetadataMatcher checkMetadata) protected voidtree(org.gcube.common.storagehub.client.dsl.FolderContainer folderContainer)
-
Field Details
-
metadataMatcher
-
storageHubClient
protected final org.gcube.common.storagehub.client.dsl.StorageHubClient storageHubClient -
persitedFile
protected org.gcube.common.storagehub.client.dsl.FileContainer persitedFile -
mimeType
-
enchriptedPrefix
- See Also:
-
-
Constructor Details
-
StorageHubManagement
public StorageHubManagement()
-
-
Method Details
-
getStorageHubClient
public org.gcube.common.storagehub.client.dsl.StorageHubClient getStorageHubClient() -
setMetadataMatcher
-
getMimeType
-
getPersistedFile
public org.gcube.common.storagehub.client.dsl.FileContainer getPersistedFile() -
recursiveList
protected void recursiveList(org.gcube.common.storagehub.client.dsl.FolderContainer folder, int level) throws org.gcube.common.storagehub.model.exceptions.StorageHubException - Throws:
org.gcube.common.storagehub.model.exceptions.StorageHubException
-
getWorkspaceRoot
protected org.gcube.common.storagehub.client.dsl.FolderContainer getWorkspaceRoot() -
getOrCreateFolder
protected org.gcube.common.storagehub.client.dsl.FolderContainer getOrCreateFolder(org.gcube.common.storagehub.client.dsl.FolderContainer parent, String name, String description, boolean hidden) throws Exception - Throws:
Exception
-
getContextFolder
protected org.gcube.common.storagehub.client.dsl.FolderContainer getContextFolder() throws Exception- Throws:
Exception
-
getApplicationFolder
public org.gcube.common.storagehub.client.dsl.FolderContainer getApplicationFolder() throws Exception- Throws:
Exception
-
getDestinationFolder
public org.gcube.common.storagehub.client.dsl.FolderContainer getDestinationFolder(String mimeType) throws Exception - Throws:
Exception
-
isPersistedFile
protected boolean isPersistedFile(org.gcube.common.storagehub.client.dsl.FileContainer fileContainer, String filename) -
logItem
protected void logItem(org.gcube.common.storagehub.client.dsl.ItemContainer<? extends org.gcube.common.storagehub.model.items.Item> itemContainer) -
logItem
protected void logItem(org.gcube.common.storagehub.client.dsl.ItemContainer<? extends org.gcube.common.storagehub.model.items.Item> itemContainer, int level) -
tree
protected void tree(org.gcube.common.storagehub.client.dsl.FolderContainer folderContainer) throws Exception - Throws:
Exception
-
getPublicLinkID
-
getFileId
- Throws:
Exception
-
getFileContainer
public org.gcube.common.storagehub.client.dsl.FileContainer getFileContainer(URL shubPublicLink) throws Exception - Throws:
Exception
-
persistFile
This method can be used only if the caller has the right to access the file already stored in the workspace- Parameters:
shubPublicLink-fileName-mimeType-- Returns:
- the public link of the persisted file
- Throws:
Exception
-
persistFile
- Throws:
Exception
-
getPersistedFile
public org.gcube.common.storagehub.client.dsl.FileContainer getPersistedFile(String filename, String mimeType) throws Exception - Throws:
Exception
-
removePersistedFile
Deprecated.The caller must have the rights to access the file- Parameters:
filename-mimeType-- Throws:
Exception
-
removePersistedFile
The caller must have the rights to access the file pointed to the public link- Parameters:
shubPublicLink-- Throws:
Exception
-