Interface BlobProvider

All Known Subinterfaces:
LiveConnectBlobProvider<O>
All Known Implementing Classes:
AbstractBlobProvider, AbstractCloudBinaryManager, AbstractLiveConnectBlobProvider, AESBlobProvider, AzureBinaryManager, AzureBlobProvider, AzureCDNBinaryManager, BinaryBlobProvider, BlobStoreBlobProvider, BoxBlobProvider, CloudFrontBinaryManager, FilesystemBlobProvider, GoogleDriveBlobProvider, GoogleStorageBinaryManager, GoogleStorageBlobProvider, GridFSBinaryManager, GridFSBlobProvider, InMemoryBlobProvider, LocalBlobProvider, S3BinaryManager, S3BlobProvider

public interface BlobProvider
Interface for a provider of Blobs, which knows how to read and write them.
Since:
7.2
  • Method Details

    • initialize

      void initialize(String blobProviderId, Map<String,String> properties) throws IOException
      Initializes the blob provider.
      Parameters:
      blobProviderId - the blob provider id for this binary manager
      properties - initialization properties
      Throws:
      IOException
      Since:
      7.3
    • close

      void close()
      Closes this blob provider and releases resources that may be held by it.
      Since:
      7.3
    • isColdStorageMode

      default boolean isColdStorageMode()
      Checks whether this blob provider uses "cold storage mode".

      Cold storage mode has the following characteristics:

      • transactional (blobs aren't actually written/deleted until the transaction commits, and transaction rollback is possible)
      Since:
      2021.19
    • isRecordMode

      default boolean isRecordMode()
      Checks whether this blob provider uses "record mode".

      Record mode has the following characteristics:

      • transactional (blobs aren't actually written/deleted until the transaction commits, and transaction rollback is possible),
      • can replace or delete a document's blob.
      Since:
      11.1
    • isTransactional

      default boolean isTransactional()
      Checks whether this blob provider is transactional.

      A transactional blob provider only writes blobs to final storage at commit time.

      Since:
      11.1
    • isTransient

      default boolean isTransient()
      Checks whether this blob provider is transient: blobs may disappear after a while, so a caller should not rely on them being available forever.
      Since:
      10.1
    • allowByteRange

      default boolean allowByteRange()
      Checks whether this blob provider allows byte ranges in keys.
      Since:
      11.1
    • allowDirectDownload

      default boolean allowDirectDownload()
      Checks whether this blob provider allows direct download.
      Since:
      2023.7
    • readBlob

      default Blob readBlob(BlobInfoContext blobInfoContext) throws IOException
      Reads a Blob from storage.
      Parameters:
      blobInfoContext - the blob information context
      Returns:
      the blob
      Throws:
      IOException
      Since:
      11.1
    • readBlob

      Blob readBlob(BlobInfo blobInfo) throws IOException
      Reads a Blob from storage.
      Parameters:
      blobInfo - the blob information
      Returns:
      the blob
      Throws:
      IOException
    • writeBlob

      default String writeBlob(BlobContext blobContext) throws IOException
      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
      Since:
      11.1
    • writeBlob

      String writeBlob(Blob blob) throws IOException
      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
      Since:
      9.2
    • updateBlob

      default void updateBlob(BlobUpdateContext blobUpdateContext) throws IOException
      Updates a blob's properties in storage.
      Parameters:
      blobUpdateContext - the blob update context
      Throws:
      IOException
      Since:
      11.1
    • deleteBlob

      default void deleteBlob(BlobContext blobContext)
      Deletes a blob from storage. Only meaningful for a record blob provider.
      Parameters:
      blobContext - the blob context
      Since:
      11.1
      See Also:
    • getStatus

      default BlobStatus getStatus(ManagedBlob blob) throws IOException
      Gets the status of a blob.
      Parameters:
      blob - the blob
      Throws:
      IOException
      Since:
      11.1
    • supportsUserUpdate

      boolean supportsUserUpdate()
      Checks if user update is supported.

      A user update refers to the fact that a blob from this provider may be overwritten with another blob, wherever the original blob may occur (usually in a document property).

      Returns:
      true if user update is supported
      Since:
      7.10
    • supportsSync

      default boolean supportsSync()
      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
      Since:
      11.1
    • getStream

      default InputStream getStream(String blobKey, ByteRange byteRange) throws IOException
      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
      Since:
      11.1
    • getStream

      default InputStream getStream(ManagedBlob blob) throws IOException
      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
      Since:
      7.3
    • getFile

      default File getFile(ManagedBlob blob)
      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
      Since:
      11.1
    • getThumbnail

      default InputStream getThumbnail(ManagedBlob blob) throws IOException
      Gets an InputStream for a thumbnail 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
      Since:
      7.3
    • getURI

      default URI getURI(ManagedBlob blob, BlobManager.UsageHint hint, javax.servlet.http.HttpServletRequest servletRequest) throws IOException
      Gets an URI for the content of a managed blob.
      Parameters:
      blob - the managed blob
      hint - BlobManager.UsageHint
      servletRequest - the servlet request, or null
      Returns:
      the URI, or null if none available
      Throws:
      IOException
      Since:
      7.4
    • getAvailableConversions

      default Map<String,URI> getAvailableConversions(ManagedBlob blob, BlobManager.UsageHint hint) throws IOException
      Gets a map of available MIME type conversions and corresponding URI for a managed blob.
      Parameters:
      blob - the managed blob
      hint - BlobManager.UsageHint
      Returns:
      a map of MIME types and URI, which may be empty
      Throws:
      IOException
      Since:
      7.3
    • canConvert

      default boolean canConvert(ManagedBlob blob, String mimeType)
      Checks if the conversion to the given mimeType is supported by the blob.
      Parameters:
      blob - the managed blob
      mimeType - the destination mime type
      Returns:
      true if this managed blob supports the conversion to the given mime type
      Since:
      10.1
    • isVersion

      default boolean isVersion(ManagedBlob blob)
      Returns true if version of the blob is a version.

      Parameters:
      blob - the managed blob
      Returns:
      true if the blob is a version or a revision
      Since:
      7.3
    • getAppLinks

      default List<AppLink> getAppLinks(String user, ManagedBlob blob) throws IOException
      Returns a list of application links for the given blob.
      Throws:
      IOException
      Since:
      7.3
    • getBinaryManager

      @Deprecated(since="2023.9") default BinaryManager getBinaryManager()
      Deprecated.
      since 2023.9, Use BlobProvider instead
      Gets the associated binary manager, if any.
      Returns:
      the binary manager, or null
      Since:
      7.4
    • getBinaryGarbageCollector

      default BinaryGarbageCollector getBinaryGarbageCollector()
      Gets the associated garbage collector, if any.
      Returns:
      the garbage collector, or null
      Since:
      11.1
    • performsExternalAccessControl

      default boolean performsExternalAccessControl(BlobInfo blobInfo)
      Checks if the blob provider performs external access control checks.
      Parameters:
      blobInfo - the blob information to be read
      Returns:
      true if the provider performs security checks before reading a blob, false otherwise
      Since:
      8.4
    • getProperties

      Map<String,String> getProperties()
      Returns the properties of the blob provider.
      Since:
      10.2
    • hasCreateFromKeyPermission

      default boolean hasCreateFromKeyPermission()
      Checks if current user has the rights to create blobs in the blob provider using a key.
      Since:
      10.2