org.outerj.daisy.blobstore
Interface BlobStore

All Known Implementing Classes:
FSBlobStore

public interface BlobStore

Stores arbitrairy blob ("binary large object") data.

The store is a write-once, read-many type of store. An existing blob cannot be updated, rather a new one needs to be written.

The user of the BlobStore is himself responsible not to retrieve or delete a blob before it is completely written.


Method Summary
 void delete(java.lang.String name)
           
 java.io.InputStream retrieve(java.lang.String name)
          The caller is responsible himself that a file is not being read before it is completely written.
 java.lang.String store(byte[] data)
          Returns an auto-generated key by which the blob can later be retrieved.
 java.lang.String store(java.io.InputStream is)
          Returns an auto-generated key by which the blob can later be retrieved.
 

Method Detail

store

public java.lang.String store(byte[] data)
                       throws BlobIOException
Returns an auto-generated key by which the blob can later be retrieved.

Throws:
BlobIOException

store

public java.lang.String store(java.io.InputStream is)
                       throws BlobIOException
Returns an auto-generated key by which the blob can later be retrieved. The InputStream will be closed for you.

Throws:
BlobIOException

retrieve

public java.io.InputStream retrieve(java.lang.String name)
                             throws BlobIOException,
                                    NonExistingBlobException
The caller is responsible himself that a file is not being read before it is completely written. The caller is also responsible for making sure the stream gets closed, otherwise resource might leak (thus: always in a try-catch block!).

Throws:
BlobIOException
NonExistingBlobException

delete

public void delete(java.lang.String name)
            throws NonExistingBlobException
Throws:
NonExistingBlobException


Copyright © -2005 . All Rights Reserved.