Package org.apache.james.mime4j.storage
Class AbstractStorageProvider
- java.lang.Object
-
- org.apache.james.mime4j.storage.AbstractStorageProvider
-
- All Implemented Interfaces:
StorageProvider
- Direct Known Subclasses:
CipherStorageProvider,MemoryStorageProvider,TempFileStorageProvider,ThresholdStorageProvider
public abstract class AbstractStorageProvider extends java.lang.Object implements StorageProvider
Abstract implementation ofStorageProviderthat implementsstore(InputStream)by copying the input stream to aStorageOutputStreamobtained fromcreateStorageOutputStream().
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractStorageProvider()Sole constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Storagestore(java.io.InputStream in)This implementation creates aStorageOutputStreamby callingcreateStorageOutputStream()and copies the content of the given input stream to that output stream.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.james.mime4j.storage.StorageProvider
createStorageOutputStream
-
-
-
-
Method Detail
-
store
public final Storage store(java.io.InputStream in) throws java.io.IOException
This implementation creates aStorageOutputStreamby callingcreateStorageOutputStream()and copies the content of the given input stream to that output stream. It then callsStorageOutputStream.toStorage()on the output stream and returns this object.- Specified by:
storein interfaceStorageProvider- Parameters:
in- stream containing the data to store.- Returns:
- a
Storageinstance that can be used to retrieve the stored content. - Throws:
java.io.IOException- if an I/O error occurs.
-
-