Class StorageHubManagement

java.lang.Object
org.gcube.storagehub.StorageHubManagement

public class StorageHubManagement extends Object
  • Field Details

    • 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:
  • Constructor Details

    • StorageHubManagement

      public StorageHubManagement()
  • Method Details

    • 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
    • getPublicLinkID

      public static String getPublicLinkID(URL url)
    • getFileId

      public static String getFileId(URL url) 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
    • removePersistedFile

      public void removePersistedFile(URL shubPublicLink) throws Exception
      The caller must have the rights to access the file pointed to the public link
      Parameters:
      shubPublicLink -
      Throws:
      Exception