Class BlobStoreBlob

  • All Implemented Interfaces:
    Blob

    public class BlobStoreBlob
    extends java.lang.Object
    implements Blob
    A blob implementation.
    • Constructor Summary

      Constructors 
      Constructor Description
      BlobStoreBlob​(BlobStore blobStore, java.lang.String blobId)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object other)  
      java.lang.String getBlobId()  
      BlobStore getBlobStore()  
      java.lang.String getContentIdentity()
      A unique identifier of the content of this value.
      @NotNull java.io.InputStream getNewStream()
      Returns a new stream for this blob.
      @Nullable java.lang.String getReference()
      Returns a secure reference to this blob, or null if such a reference is not available.
      int hashCode()  
      boolean isInlined()
      Checks if the external blob is inlined in the id itself
      long length()
      Returns the length of this blob or -1 if unknown.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • BlobStoreBlob

        public BlobStoreBlob​(BlobStore blobStore,
                             java.lang.String blobId)
    • Method Detail

      • getNewStream

        @NotNull
        public @NotNull java.io.InputStream getNewStream()
        Description copied from interface: Blob
        Returns a new stream for this blob. The streams returned from multiple calls to this method are byte wise equals. That is, subsequent calls to read return the same sequence of bytes as long as neither call throws an exception.
        Specified by:
        getNewStream in interface Blob
        Returns:
        a new stream for this blob
      • length

        public long length()
        Description copied from interface: Blob
        Returns the length of this blob or -1 if unknown.
        Specified by:
        length in interface Blob
        Returns:
        the length of this blob.
      • getReference

        @Nullable
        public @Nullable java.lang.String getReference()
        Description copied from interface: Blob
        Returns a secure reference to this blob, or null if such a reference is not available.
        Specified by:
        getReference in interface Blob
        Returns:
        binary reference, or null
        See Also:
        OAK-834
      • getContentIdentity

        public java.lang.String getContentIdentity()
        Description copied from interface: Blob
        A unique identifier of the content of this value. Usually this is a message digest of the content (a cryptographically secure one-way hash). This allows to avoid processing large binary values multiple times.

        This method returns null if the identifier is unknown. The identifier may not always be available, for example if the value has not yet been saved or processed. Once an identifier is available, it will never change because values are immutable.

        If two values have the same identifier, the content of the value is guaranteed to be the same. However it is not guaranteed that two values with the same content will return the same identifier.

        The identifier is opaque, meaning it can have any format and size.

        Specified by:
        getContentIdentity in interface Blob
        Returns:
        the unique identifier or null
      • isInlined

        public boolean isInlined()
        Description copied from interface: Blob
        Checks if the external blob is inlined in the id itself
        Specified by:
        isInlined in interface Blob
        Returns:
      • getBlobId

        public java.lang.String getBlobId()
      • getBlobStore

        public BlobStore getBlobStore()
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object