Class SimpleManagedBlob

java.lang.Object
org.nuxeo.ecm.core.api.impl.blob.AbstractBlob
org.nuxeo.ecm.core.blob.SimpleManagedBlob
All Implemented Interfaces:
Serializable, Blob, ManagedBlob

public class SimpleManagedBlob extends AbstractBlob implements ManagedBlob
Simple managed blob implementation holding just a key and delegating to its provider for implementation.
Since:
7.2
See Also:
  • Field Details

    • blobProviderId

      public final String blobProviderId
    • key

      public final String key
    • length

      public Long length
  • Constructor Details

    • SimpleManagedBlob

      public SimpleManagedBlob(String blobProviderId, BlobInfo blobInfo)
    • SimpleManagedBlob

      public SimpleManagedBlob(BlobInfo blobInfo)
  • Method Details

    • withKeyAndDigest

      public SimpleManagedBlob withKeyAndDigest(String newKey, String newDigest)
      Returns a copy of this blob with a new key and digest.
      Since:
      11.5
    • getProviderId

      public String getProviderId()
      Description copied from interface: ManagedBlob
      Gets the id of the BlobProvider managing this blob.
      Specified by:
      getProviderId in interface ManagedBlob
      Returns:
      the blob provider id
    • getKey

      public String getKey()
      Description copied from interface: ManagedBlob
      Gets the stored representation of this blob.
      Specified by:
      getKey in interface ManagedBlob
      Returns:
      the stored representation
    • blobProviderIdFromKey

      protected static String blobProviderIdFromKey(String key)
    • getFile

      public File getFile()
      Description copied from interface: Blob
      If this blob is backed by an actual file, returns it.

      The returned file may be short-lived (temporary), so should be used immediately.

      Specified by:
      getFile in interface Blob
      Specified by:
      getFile in interface ManagedBlob
      Overrides:
      getFile in class AbstractBlob
      Returns:
      a file, or null if the blob is not backed by a file
    • getLength

      public long getLength()
      Description copied from interface: Blob
      Gets the data length in bytes if known.
      Specified by:
      getLength in interface Blob
      Overrides:
      getLength in class AbstractBlob
      Returns:
      the data length or -1 if not known