Class AwsBlobStore

    • Constructor Detail

      • AwsBlobStore

        public AwsBlobStore()
      • AwsBlobStore

        public AwsBlobStore​(AwsBlobStore.Builder builder,
                            software.amazon.awssdk.services.s3.S3Client s3Client)
    • Method Detail

      • shouldConfigureHttpClient

        protected static boolean shouldConfigureHttpClient​(AwsBlobStore.Builder builder)
        Helper function to determine if any of the HttpClient configuration options have been set
      • builder

        public AwsBlobStore.Builder builder()
        Description copied from interface: Provider
        Creates and returns a new Builder instance for this provider.
        Returns:
        A Builder instance for constructing this provider.
      • getException

        public Class<? extends SubstrateSdkException> getException​(Throwable t)
        Description copied from interface: SdkService
        Maps a given Throwable from the provider implementation to a specific SubstrateSdkException. This is used for exception handling abstraction.
        Parameters:
        t - The Throwable to be mapped.
        Returns:
        The Class of the corresponding SubstrateSdkException.
      • doUpload

        protected UploadResponse doUpload​(UploadRequest uploadRequest,
                                          InputStream inputStream)
        Performs Blob upload Note: Specifying the contentLength in the UploadRequest can dramatically improve upload efficiency because the substrate SDKs do not need to buffer the contents and calculate it themselves.
        Specified by:
        doUpload in class AbstractBlobStore<AwsBlobStore>
        Parameters:
        uploadRequest - Wrapper object containing upload data
        inputStream - The input stream that contains the blob content
        Returns:
        Wrapper object containing the upload result data
      • doUpload

        protected UploadResponse doUpload​(UploadRequest uploadRequest,
                                          byte[] content)
        Performs Blob upload
        Specified by:
        doUpload in class AbstractBlobStore<AwsBlobStore>
        Parameters:
        uploadRequest - Wrapper object containing upload data
        content - The byte array that contains the blob content
        Returns:
        Wrapper object containing the upload result data
      • doUpload

        protected UploadResponse doUpload​(UploadRequest uploadRequest,
                                          File file)
        Performs Blob upload
        Specified by:
        doUpload in class AbstractBlobStore<AwsBlobStore>
        Parameters:
        uploadRequest - Wrapper object containing upload data
        file - The File that contains the blob content
        Returns:
        Wrapper object containing the upload result data
      • doUpload

        protected UploadResponse doUpload​(UploadRequest uploadRequest,
                                          Path path)
        Performs Blob upload
        Specified by:
        doUpload in class AbstractBlobStore<AwsBlobStore>
        Parameters:
        uploadRequest - Wrapper object containing upload data
        path - The Path that contains the blob content
        Returns:
        Wrapper object containing the upload result data
      • doUpload

        protected UploadResponse doUpload​(UploadRequest uploadRequest,
                                          software.amazon.awssdk.core.sync.RequestBody requestBody)
        Helper function to upload blobs
      • doDownload

        protected DownloadResponse doDownload​(DownloadRequest downloadRequest,
                                              OutputStream outputStream)
        Performs Blob download
        Specified by:
        doDownload in class AbstractBlobStore<AwsBlobStore>
        Parameters:
        downloadRequest - Wrapper object containing download data
        outputStream - The output stream that the blob content will be written to
        Returns:
        Returns a DownloadResponse object that contains metadata about the blob
      • doDownload

        protected DownloadResponse doDownload​(DownloadRequest downloadRequest,
                                              ByteArray byteArray)
        Performs Blob download
        Specified by:
        doDownload in class AbstractBlobStore<AwsBlobStore>
        Parameters:
        downloadRequest - Wrapper object containing download data
        byteArray - The byte array that blob content will be written to
        Returns:
        Returns a DownloadResponse object that contains metadata about the blob
      • doDownload

        protected DownloadResponse doDownload​(DownloadRequest downloadRequest,
                                              File file)
        Performs Blob download
        Specified by:
        doDownload in class AbstractBlobStore<AwsBlobStore>
        Parameters:
        downloadRequest - Wrapper object containing download data
        file - The File the blob content will be written to
        Returns:
        Returns a DownloadResponse object that contains metadata about the blob
      • doDownload

        protected DownloadResponse doDownload​(DownloadRequest downloadRequest,
                                              Path path)
        Performs Blob download
        Specified by:
        doDownload in class AbstractBlobStore<AwsBlobStore>
        Parameters:
        downloadRequest - Wrapper object containing download data
        path - The Path that blob content will be written to
        Returns:
        Returns a DownloadResponse object that contains metadata about the blob
      • doDelete

        protected void doDelete​(String key,
                                String versionId)
        Deletes a single Blob
        Specified by:
        doDelete in class AbstractBlobStore<AwsBlobStore>
        Parameters:
        key - The key of the Blob to be deleted
        versionId - The versionId of the blob
      • doGetMetadata

        protected BlobMetadata doGetMetadata​(String key,
                                             String versionId)
        Retrieves the Blob metadata
        Specified by:
        doGetMetadata in class AbstractBlobStore<AwsBlobStore>
        Parameters:
        key - Key of the Blob whose metadata is to be retrieved
        versionId - The versionId of the blob. This field is optional and only used if your bucket has versioning enabled. This value should be null unless you're targeting a specific key/version blob.
        Returns:
        Wrapper Blob metadata object
      • getPresigner

        protected software.amazon.awssdk.services.s3.presigner.S3Presigner getPresigner()
        Returns an S3Presigner for the current credentials
        Returns:
        Returns an S3Presigner for the current credentials
      • doDoesObjectExist

        protected boolean doDoesObjectExist​(String key,
                                            String versionId)
        Determines if an object exists for a given key/versionId
        Specified by:
        doDoesObjectExist in class AbstractBlobStore<AwsBlobStore>
        Parameters:
        key - Name of the blob to check
        versionId - The version of the blob to check
        Returns:
        Returns true if the object exists. Returns false if it doesn't exist.