Class WrappingSplitBlobStore

java.lang.Object
org.apache.jackrabbit.oak.spi.blob.split.WrappingSplitBlobStore
All Implemented Interfaces:
AutoCloseable, BlobStore, BlobStoreWrapper, SplitBlobStore

public class WrappingSplitBlobStore extends Object implements BlobStoreWrapper, SplitBlobStore
  • Constructor Details

    • WrappingSplitBlobStore

      public WrappingSplitBlobStore(String repositoryDir, BlobStore newBlobStore)
  • Method Details

    • setBlobStore

      public void setBlobStore(BlobStore blobStore)
      Specified by:
      setBlobStore in interface BlobStoreWrapper
    • writeBlob

      public String writeBlob(InputStream in) throws IOException
      Description copied from interface: BlobStore
      Write a blob from an input stream. This method closes the input stream.
      Specified by:
      writeBlob in interface BlobStore
      Parameters:
      in - the input stream
      Returns:
      the blob id
      Throws:
      IOException
    • writeBlob

      public String writeBlob(InputStream in, BlobOptions options) throws IOException
      Ignores the options provided and delegates to writeBlob(InputStream).
      Specified by:
      writeBlob in interface BlobStore
      Parameters:
      in - the input stream to write
      options - the options to use
      Returns:
      Throws:
      IOException
    • readBlob

      public int readBlob(String blobId, long pos, byte[] buff, int off, int length) throws IOException
      Description copied from interface: BlobStore
      Read a number of bytes from a blob.
      Specified by:
      readBlob in interface BlobStore
      Parameters:
      blobId - the blob id
      pos - the position within the blob
      buff - the target byte array
      off - the offset within the target array
      length - the number of bytes to read
      Returns:
      the number of bytes read
      Throws:
      IOException
    • getBlobLength

      public long getBlobLength(String blobId) throws IOException
      Description copied from interface: BlobStore
      Get the length of the blob.
      Specified by:
      getBlobLength in interface BlobStore
      Parameters:
      blobId - the blob id
      Returns:
      the length
      Throws:
      IOException
    • getInputStream

      public InputStream getInputStream(String blobId) throws IOException
      Description copied from interface: BlobStore
      Returns a new stream for given blobId. 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:
      getInputStream in interface BlobStore
      Parameters:
      blobId - the blob id
      Returns:
      a new stream for given blobId
      Throws:
      IOException
    • getBlobId

      public String getBlobId(String reference)
      Description copied from interface: BlobStore
      Returns the blobId that referred by the given binary reference. Returns null if the reference is invalid, for example if it points to a blob that does not exist.
      Specified by:
      getBlobId in interface BlobStore
      Parameters:
      reference - binary reference
      Returns:
      matching blobId, or null
    • getReference

      public String getReference(String blobId)
      Description copied from interface: BlobStore
      Returns a secure reference to blob referred by blobid, or null if no such reference is available.
      Specified by:
      getReference in interface BlobStore
      Parameters:
      blobId - blobId referring the blob for which reference is required
      Returns:
      binary reference, or null
    • isMigrated

      public boolean isMigrated(String blobId) throws IOException
      Specified by:
      isMigrated in interface SplitBlobStore
      Throws:
      IOException
    • close

      public void close() throws Exception
      Specified by:
      close in interface AutoCloseable
      Throws:
      Exception