Package org.gcube.storagehub
Class StorageHubManagement
- java.lang.Object
-
- org.gcube.storagehub.StorageHubManagement
-
public class StorageHubManagement extends Object
-
-
Field Summary
Fields Modifier and Type Field Description static StringenchriptedPrefixprotected MetadataMatchermetadataMatcherprotected StringmimeTypeprotected org.gcube.common.storagehub.client.dsl.FileContainerpersitedFileprotected org.gcube.common.storagehub.client.dsl.StorageHubClientstorageHubClient
-
Constructor Summary
Constructors Constructor Description StorageHubManagement()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description org.gcube.common.storagehub.client.dsl.FolderContainergetApplicationFolder()protected org.gcube.common.storagehub.client.dsl.FolderContainergetContextFolder()org.gcube.common.storagehub.client.dsl.FolderContainergetDestinationFolder(String mimeType)org.gcube.common.storagehub.client.dsl.FileContainergetFileContainer(URL shubPublicLink)static StringgetFileId(URL url)StringgetMimeType()protected 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.FileContainergetPersistedFile()org.gcube.common.storagehub.client.dsl.FileContainergetPersistedFile(String filename, String mimeType)static StringgetPublicLinkID(URL url)org.gcube.common.storagehub.client.dsl.StorageHubClientgetStorageHubClient()protected org.gcube.common.storagehub.client.dsl.FolderContainergetWorkspaceRoot()protected 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)URLpersistFile(InputStream inputStream, String fileName, String mimeType)URLpersistFile(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 Detail
-
metadataMatcher
protected MetadataMatcher metadataMatcher
-
storageHubClient
protected final org.gcube.common.storagehub.client.dsl.StorageHubClient storageHubClient
-
persitedFile
protected org.gcube.common.storagehub.client.dsl.FileContainer persitedFile
-
mimeType
protected String mimeType
-
enchriptedPrefix
public static final String enchriptedPrefix
- See Also:
- Constant Field Values
-
-
Method Detail
-
getStorageHubClient
public org.gcube.common.storagehub.client.dsl.StorageHubClient getStorageHubClient()
-
setMetadataMatcher
public void setMetadataMatcher(MetadataMatcher checkMetadata)
-
getMimeType
public String 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
-
getFileContainer
public org.gcube.common.storagehub.client.dsl.FileContainer getFileContainer(URL shubPublicLink) throws Exception
- Throws:
Exception
-
persistFile
public URL persistFile(URL shubPublicLink, String fileName, String mimeType) throws Exception
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
public URL persistFile(InputStream inputStream, String fileName, String mimeType) throws Exception
- Throws:
Exception
-
getPersistedFile
public org.gcube.common.storagehub.client.dsl.FileContainer getPersistedFile(String filename, String mimeType) throws Exception
- Throws:
Exception
-
removePersistedFile
@Deprecated public void removePersistedFile(String filename, String mimeType) throws Exception
Deprecated.The caller must have the rights to access the file- Parameters:
filename-mimeType-- Throws:
Exception
-
-