Class WrappingSplitBlobStore
java.lang.Object
org.apache.jackrabbit.oak.spi.blob.split.WrappingSplitBlobStore
- All Implemented Interfaces:
AutoCloseable
,BlobStore
,BlobStoreWrapper
,SplitBlobStore
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
Returns the blobId that referred by the given binary reference.long
getBlobLength
(String blobId) Get the length of the blob.getInputStream
(String blobId) Returns a new stream for given blobId.getReference
(String blobId) Returns a secure reference to blob referred by blobid, ornull
if no such reference is available.boolean
isMigrated
(String blobId) int
Read a number of bytes from a blob.void
setBlobStore
(BlobStore blobStore) writeBlob
(InputStream in) Write a blob from an input stream.writeBlob
(InputStream in, BlobOptions options) Ignores the options provided and delegates towriteBlob(InputStream)
.
-
Constructor Details
-
WrappingSplitBlobStore
-
-
Method Details
-
setBlobStore
- Specified by:
setBlobStore
in interfaceBlobStoreWrapper
-
writeBlob
Description copied from interface:BlobStore
Write a blob from an input stream. This method closes the input stream.- Specified by:
writeBlob
in interfaceBlobStore
- Parameters:
in
- the input stream- Returns:
- the blob id
- Throws:
IOException
-
writeBlob
Ignores the options provided and delegates towriteBlob(InputStream)
.- Specified by:
writeBlob
in interfaceBlobStore
- Parameters:
in
- the input stream to writeoptions
- the options to use- Returns:
- Throws:
IOException
-
readBlob
Description copied from interface:BlobStore
Read a number of bytes from a blob.- Specified by:
readBlob
in interfaceBlobStore
- Parameters:
blobId
- the blob idpos
- the position within the blobbuff
- the target byte arrayoff
- the offset within the target arraylength
- the number of bytes to read- Returns:
- the number of bytes read
- Throws:
IOException
-
getBlobLength
Description copied from interface:BlobStore
Get the length of the blob.- Specified by:
getBlobLength
in interfaceBlobStore
- Parameters:
blobId
- the blob id- Returns:
- the length
- Throws:
IOException
-
getInputStream
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 toread
return the same sequence of bytes as long as neither call throws an exception.- Specified by:
getInputStream
in interfaceBlobStore
- Parameters:
blobId
- the blob id- Returns:
- a new stream for given blobId
- Throws:
IOException
-
getBlobId
Description copied from interface:BlobStore
Returns the blobId that referred by the given binary reference. Returnsnull
if the reference is invalid, for example if it points to a blob that does not exist. -
getReference
Description copied from interface:BlobStore
Returns a secure reference to blob referred by blobid, ornull
if no such reference is available.- Specified by:
getReference
in interfaceBlobStore
- Parameters:
blobId
- blobId referring the blob for which reference is required- Returns:
- binary reference, or
null
-
isMigrated
- Specified by:
isMigrated
in interfaceSplitBlobStore
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Throws:
Exception
-