Class BlobStoreBlobProvider

java.lang.Object
org.nuxeo.ecm.core.blob.AbstractBlobProvider
org.nuxeo.ecm.core.blob.BlobStoreBlobProvider
All Implemented Interfaces:
BlobProvider
Direct Known Subclasses:
AzureBlobProvider, GoogleStorageBlobProvider, GridFSBlobProvider, InMemoryBlobProvider, LocalBlobProvider, S3BlobProvider

public abstract class BlobStoreBlobProvider extends AbstractBlobProvider
A BlobProvider implemented on top of an underlying BlobStore.

This abstract class deals with

  • Field Details

  • Constructor Details

    • BlobStoreBlobProvider

      public BlobStoreBlobProvider()
  • Method Details

    • initialize

      public void initialize(String blobProviderId, Map<String,String> properties) throws IOException
      Description copied from interface: BlobProvider
      Initializes the blob provider.
      Specified by:
      initialize in interface BlobProvider
      Overrides:
      initialize in class AbstractBlobProvider
      Parameters:
      blobProviderId - the blob provider id for this binary manager
      properties - initialization properties
      Throws:
      IOException
    • getBlobStore

      protected abstract BlobStore getBlobStore(String blobProviderId, Map<String,String> properties) throws IOException
      Throws:
      IOException
    • allowDirectDownload

      public boolean allowDirectDownload()
      Description copied from interface: BlobProvider
      Checks whether this blob provider allows direct download.
    • getKeyStrategy

      public KeyStrategy getKeyStrategy()
      Since:
      11.2
    • getDigestAlgorithm

      protected abstract String getDigestAlgorithm()
      The digest algorithm to use for the default key strategy.
    • supportsSync

      public boolean supportsSync()
      Description copied from interface: BlobProvider
      Checks if sync is supported.

      Sync refers to the fact that a blob from this provider may be synced with a remote system (like Nuxeo Drive) or with a process that updates things in the blob (like Binary Metadata, or WOPI).

      Returns:
      true if sync is supported
    • getBinaryGarbageCollector

      public BinaryGarbageCollector getBinaryGarbageCollector()
      Description copied from interface: BlobProvider
      Gets the associated garbage collector, if any.
      Returns:
      the garbage collector, or null
    • isValidKey

      public boolean isValidKey(String key)
      Does the given key have the expected pattern for the provider's key strategy.
      Since:
      2023.5
    • stripBlobKeyPrefix

      protected String stripBlobKeyPrefix(String key)
    • stripBlobKeyVersionSuffix

      protected String stripBlobKeyVersionSuffix(String key)
    • writeBlob

      public String writeBlob(BlobContext blobContext) throws IOException
      Description copied from interface: BlobProvider
      Writes a Blob to storage and returns information about it.

      Called to store a user-created blob.

      Parameters:
      blobContext - the blob context
      Returns:
      the blob key
      Throws:
      IOException
    • writeBlob

      public String writeBlob(Blob blob) throws IOException
      Description copied from interface: BlobProvider
      Writes a Blob to storage and returns information about it.

      Called to store a user-created blob.

      Parameters:
      blob - the blob
      Returns:
      the blob key
      Throws:
      IOException
    • getStream

      public InputStream getStream(ManagedBlob blob) throws IOException
      Description copied from interface: BlobProvider
      Gets an InputStream for the data of a managed blob.

      Like all InputStream, the result must be closed when done with it to avoid resource leaks.

      Parameters:
      blob - the managed blob
      Returns:
      the stream
      Throws:
      IOException
    • getStream

      public InputStream getStream(String blobKey, ByteRange byteRange) throws IOException
      Description copied from interface: BlobProvider
      Gets an InputStream for a byte range of a managed blob.
      Parameters:
      blobKey - the blob key
      byteRange - the byte range
      Returns:
      the stream
      Throws:
      IOException
    • getFile

      public File getFile(ManagedBlob blob)
      Description copied from interface: BlobProvider
      Gets a File (if one exists) for the data of a managed blob.
      Parameters:
      blob - the managed blob
      Returns:
      the file, or null if no underlying file is available
    • readBlob

      public Blob readBlob(BlobInfo blobInfo) throws IOException
      Description copied from interface: BlobProvider
      Reads a Blob from storage.
      Parameters:
      blobInfo - the blob information
      Returns:
      the blob
      Throws:
      IOException
    • fixupDigest

      protected void fixupDigest(Blob blob, String key)
      Fixup of the blob's digest, if possible.
      Parameters:
      blob - the blob
      key - the key
      Since:
      11.2
    • updateBlob

      public void updateBlob(BlobUpdateContext blobUpdateContext) throws IOException
      Description copied from interface: BlobProvider
      Updates a blob's properties in storage.
      Parameters:
      blobUpdateContext - the blob update context
      Throws:
      IOException
    • deleteBlob

      public void deleteBlob(BlobContext blobContext)
      Description copied from interface: BlobProvider
      Deletes a blob from storage. Only meaningful for a record blob provider.
      Parameters:
      blobContext - the blob context
      See Also:
    • getStoreScrollName

      public abstract String getStoreScrollName()
      Gets the name of the scroll to scroll the blobs of the underlying blob store.
      Since:
      2023