org.apache.jackrabbit.mk.blobs
Interface BlobStore

All Known Implementing Classes:
AbstractBlobStore, DbBlobStore, FileBlobStore, MemoryBlobStore, MongoBlobStore, MongoPersistence

public interface BlobStore

An interface to store and read large binary objects.


Method Summary
 String addBlob(String tempFilePath)
          Write a blob from a temporary file.
 void close()
           
 long getBlobLength(String blobId)
           
 int readBlob(String blobId, long pos, byte[] buff, int off, int length)
           
 String writeBlob(InputStream in)
          Write a blob from an input stream.
 

Method Detail

addBlob

String addBlob(String tempFilePath)
               throws Exception
Write a blob from a temporary file. The temporary file is removed afterwards. A file based blob stores might simply rename the file, so that no additional writes are necessary.

Parameters:
tempFilePath - the temporary file
Returns:
the blob id
Throws:
Exception

writeBlob

String writeBlob(InputStream in)
                 throws Exception
Write a blob from an input stream. This method closes the input stream.

Parameters:
in - the input stream
Returns:
the blob id
Throws:
Exception

readBlob

int readBlob(String blobId,
             long pos,
             byte[] buff,
             int off,
             int length)
             throws Exception
Throws:
Exception

getBlobLength

long getBlobLength(String blobId)
                   throws Exception
Throws:
Exception

close

void close()


Copyright © 2012 The Apache Software Foundation. All Rights Reserved.