|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.outerj.daisy.blobstore.impl.FSBlobStore
public class FSBlobStore
Implementation of BlobStore that stores blobs in a directory
on the filesystem.
This class in an Avalon component, and hence its lifecycle interfaces should be respected before being used.
| Constructor Summary | |
|---|---|
FSBlobStore()
|
|
| Method Summary | |
|---|---|
void |
configure(org.apache.avalon.framework.configuration.Configuration configuration)
|
void |
delete(java.lang.String name)
|
EDU.oswego.cs.dl.util.concurrent.Sync |
getAvoidSuspendLock()
Returns a lock which can be acquired to avoid that the BlobStore can go into suspension while you have this lock. |
void |
initialize()
|
void |
resumeWrites()
Resumes write operations (after being suspended with BlobStore.suspendWrites(long). |
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. |
boolean |
suspendWrites(long msecs)
Suspends all write operations to the blob store, after calling this method only read operation will be allowed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public FSBlobStore()
| Method Detail |
|---|
public void configure(org.apache.avalon.framework.configuration.Configuration configuration)
throws org.apache.avalon.framework.configuration.ConfigurationException
configure in interface org.apache.avalon.framework.configuration.Configurableorg.apache.avalon.framework.configuration.ConfigurationException
public void initialize()
throws java.lang.Exception
initialize in interface org.apache.avalon.framework.activity.Initializablejava.lang.Exception
public void delete(java.lang.String name)
throws NonExistingBlobException
delete in interface BlobStoreNonExistingBlobException
public java.lang.String store(byte[] data)
throws BlobIOException
BlobStore
store in interface BlobStoreBlobIOException
public java.lang.String store(java.io.InputStream is)
throws BlobIOException
BlobStore
store in interface BlobStoreBlobIOException
public java.io.InputStream retrieve(java.lang.String name)
throws BlobIOException,
NonExistingBlobException
BlobStore
retrieve in interface BlobStoreBlobIOException
NonExistingBlobException
public boolean suspendWrites(long msecs)
throws java.lang.InterruptedException
BlobStore
suspendWrites in interface BlobStoremsecs - max time to wait for active write operations to finish
java.lang.InterruptedExceptionpublic void resumeWrites()
BlobStoreBlobStore.suspendWrites(long).
resumeWrites in interface BlobStorepublic EDU.oswego.cs.dl.util.concurrent.Sync getAvoidSuspendLock()
BlobStore
getAvoidSuspendLock in interface BlobStore
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||