|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.james.mime4j.storage.AbstractStorageProvider
org.apache.james.mime4j.storage.ThresholdStorageProvider
public class ThresholdStorageProvider
A StorageProvider that keeps small amounts of data in memory and
writes the remainder to another StorageProvider (the back-end)
if a certain threshold size gets exceeded.
Example usage:
StorageProvider tempStore = new TempFileStorageProvider(); StorageProvider provider = new ThresholdStorageProvider(tempStore, 4096); DefaultStorageProvider.setInstance(provider);
| Constructor Summary | |
|---|---|
ThresholdStorageProvider(StorageProvider backend)
Creates a new ThresholdStorageProvider for the given
back-end using a threshold size of 2048 bytes. |
|
ThresholdStorageProvider(StorageProvider backend,
int thresholdSize)
Creates a new ThresholdStorageProvider for the given
back-end and threshold size. |
|
| Method Summary | |
|---|---|
StorageOutputStream |
createStorageOutputStream()
Creates a StorageOutputStream where data to be stored can be
written to. |
| Methods inherited from class org.apache.james.mime4j.storage.AbstractStorageProvider |
|---|
store |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ThresholdStorageProvider(StorageProvider backend)
ThresholdStorageProvider for the given
back-end using a threshold size of 2048 bytes.
public ThresholdStorageProvider(StorageProvider backend,
int thresholdSize)
ThresholdStorageProvider for the given
back-end and threshold size.
backend - used to store the remainder of the data if the threshold size
gets exceeded.thresholdSize - determines how much bytes are kept in memory before that
back-end storage provider is used to store the remainder of
the data.| Method Detail |
|---|
public StorageOutputStream createStorageOutputStream()
StorageProviderStorageOutputStream where data to be stored can be
written to. Subsequently the user can call
toStorage() on that object to get
a Storage instance that holds the data that has been written.
StorageOutputStream where data can be written to.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||