Class AbstractStorageProvider
java.lang.Object
org.apache.james.mime4j.storage.AbstractStorageProvider
- All Implemented Interfaces:
StorageProvider
- Direct Known Subclasses:
CipherStorageProvider, MemoryStorageProvider, TempFileStorageProvider, ThresholdStorageProvider
Abstract implementation of
StorageProvider that implements
store(InputStream) by copying the
input stream to a StorageOutputStream obtained from
createStorageOutputStream().-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal Storagestore(InputStream in) This implementation creates aStorageOutputStreamby callingcreateStorageOutputStream()and copies the content of the given input stream to that output stream.Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface StorageProvider
createStorageOutputStream
-
Constructor Details
-
AbstractStorageProvider
protected AbstractStorageProvider()Sole constructor.
-
-
Method Details
-
store
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:
IOException- if an I/O error occurs.
-