Interface StorageService


  • public interface StorageService
    Implementations of this interface provides supports to a cloud storage service
    • Method Detail

      • createBucket

        void createBucket​(String bucketName,
                          Property... properties)
                   throws IOException
        Creates a Bucket
        Parameters:
        bucketName - the bucket's name
        properties - specific connection properties
        Throws:
        IOException - an IO exception of this operation
      • hasBucket

        boolean hasBucket​(String bucketName,
                          Property... properties)
                   throws IOException
        Checks if the Bucket exists
        Parameters:
        bucketName - the bucket's name
        properties - specific connection properties
        Returns:
        boolean true if buckets exists or false if not
        Throws:
        IOException - an IO exception of this operation
      • loadObjectsByIds

        List<com.google.cloud.storage.Blob> loadObjectsByIds​(String bucketName,
                                                             List<String> blobIds,
                                                             Property... properties)
                                                      throws IOException
        Loads the content of all ids informed
        Parameters:
        bucketName - the bucket's name
        blobIds - list[string] of the object's ids
        properties - specific connection properties
        Returns:
        multitype:Blob a list of all the objects content
        Throws:
        IOException - an IO exception of this operation
      • loadObjectsByIds

        List<com.google.cloud.storage.Blob> loadObjectsByIds​(List<com.google.cloud.storage.BlobId> blobIds,
                                                             Property... properties)
                                                      throws IOException
        Loads the content of all ids informed
        Parameters:
        blobIds - list[BlobId] of the object's ids
        properties - specific connection properties
        Returns:
        multitype:Blob a list of all the objects content
        Throws:
        IOException - an IO exception of this operation
      • listObjects

        String[] listObjects​(String bucketName,
                             String startsWith,
                             Property... properties)
                      throws IOException,
                             ObjectNotFoundException
        List object's names based on an optional prefix string
        Parameters:
        bucketName - the bucket's name
        startsWith - a prefix string
        properties - specific connection properties
        Returns:
        string[] a list of object's names
        Throws:
        IOException - an IO exception of this operation
        ObjectNotFoundException - an object not found exception
      • createDeleteSignedUrl

        String createDeleteSignedUrl​(String bucketName,
                                     String blobName,
                                     String expiresIn,
                                     Property... properties)
                              throws IOException,
                                     ObjectNotFoundException
        Creates a delete signed url
        Parameters:
        bucketName - the bucket's name
        blobName - the object's name
        expiresIn - the url expiration
        properties - specific connection properties
        Returns:
        string the signed url
        Throws:
        IOException - an IO exception of this operation
        ObjectNotFoundException - an object not found exception
      • createUploadSignedUrl

        String createUploadSignedUrl​(String bucketName,
                                     String blobName,
                                     String type,
                                     String expiresIn,
                                     Property... properties)
                              throws IOException,
                                     ObjectNotFoundException
        Creates a upload signed url
        Parameters:
        bucketName - the bucket's name
        blobName - the object's name
        type - the object's mimetype
        properties - specific connection properties
        expiresIn - the url expiration
        Returns:
        string the signed url
        Throws:
        IOException - an IO exception of this operation
        ObjectNotFoundException - an object not found exception