Class WrappingSplitBlobStore
- java.lang.Object
-
- org.apache.jackrabbit.oak.spi.blob.split.WrappingSplitBlobStore
-
- All Implemented Interfaces:
java.lang.AutoCloseable,BlobStore,BlobStoreWrapper,SplitBlobStore
public class WrappingSplitBlobStore extends java.lang.Object implements BlobStoreWrapper, SplitBlobStore
-
-
Constructor Summary
Constructors Constructor Description WrappingSplitBlobStore(java.lang.String repositoryDir, BlobStore newBlobStore)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()java.lang.StringgetBlobId(java.lang.String reference)Returns the blobId that referred by the given binary reference.longgetBlobLength(java.lang.String blobId)Get the length of the blob.java.io.InputStreamgetInputStream(java.lang.String blobId)Returns a new stream for given blobId.java.lang.StringgetReference(java.lang.String blobId)Returns a secure reference to blob referred by blobid, ornullif no such reference is available.booleanisMigrated(java.lang.String blobId)intreadBlob(java.lang.String blobId, long pos, byte[] buff, int off, int length)Read a number of bytes from a blob.voidsetBlobStore(BlobStore blobStore)java.lang.StringwriteBlob(java.io.InputStream in)Write a blob from an input stream.java.lang.StringwriteBlob(java.io.InputStream in, BlobOptions options)Ignores the options provided and delegates towriteBlob(InputStream).
-
-
-
Constructor Detail
-
WrappingSplitBlobStore
public WrappingSplitBlobStore(java.lang.String repositoryDir, BlobStore newBlobStore)
-
-
Method Detail
-
setBlobStore
public void setBlobStore(BlobStore blobStore)
- Specified by:
setBlobStorein interfaceBlobStoreWrapper
-
writeBlob
public java.lang.String writeBlob(java.io.InputStream in) throws java.io.IOExceptionDescription copied from interface:BlobStoreWrite a blob from an input stream. This method closes the input stream.
-
writeBlob
public java.lang.String writeBlob(java.io.InputStream in, BlobOptions options) throws java.io.IOExceptionIgnores the options provided and delegates towriteBlob(InputStream).
-
readBlob
public int readBlob(java.lang.String blobId, long pos, byte[] buff, int off, int length) throws java.io.IOExceptionDescription copied from interface:BlobStoreRead a number of bytes from a blob.
-
getBlobLength
public long getBlobLength(java.lang.String blobId) throws java.io.IOExceptionDescription copied from interface:BlobStoreGet the length of the blob.- Specified by:
getBlobLengthin interfaceBlobStore- Parameters:
blobId- the blob id- Returns:
- the length
- Throws:
java.io.IOException
-
getInputStream
public java.io.InputStream getInputStream(java.lang.String blobId) throws java.io.IOExceptionDescription copied from interface:BlobStoreReturns a new stream for given blobId. The streams returned from multiple calls to this method are byte wise equals. That is, subsequent calls toreadreturn the same sequence of bytes as long as neither call throws an exception.- Specified by:
getInputStreamin interfaceBlobStore- Parameters:
blobId- the blob id- Returns:
- a new stream for given blobId
- Throws:
java.io.IOException
-
getBlobId
public java.lang.String getBlobId(java.lang.String reference)
Description copied from interface:BlobStoreReturns the blobId that referred by the given binary reference. Returnsnullif the reference is invalid, for example if it points to a blob that does not exist.
-
getReference
public java.lang.String getReference(java.lang.String blobId)
Description copied from interface:BlobStoreReturns a secure reference to blob referred by blobid, ornullif no such reference is available.- Specified by:
getReferencein interfaceBlobStore- Parameters:
blobId- blobId referring the blob for which reference is required- Returns:
- binary reference, or
null
-
isMigrated
public boolean isMigrated(java.lang.String blobId) throws java.io.IOException- Specified by:
isMigratedin interfaceSplitBlobStore- Throws:
java.io.IOException
-
close
public void close() throws java.lang.Exception- Specified by:
closein interfacejava.lang.AutoCloseable- Throws:
java.lang.Exception
-
-