Package org.apache.james.mime4j.storage
Interface StorageProvider
-
- All Known Implementing Classes:
AbstractStorageProvider,CipherStorageProvider,MemoryStorageProvider,TempFileStorageProvider,ThresholdStorageProvider
public interface StorageProviderProvides a strategy for storing the contents of anInputStreamor retrieving the content written to anOutputStream.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description StorageOutputStreamcreateStorageOutputStream()Creates aStorageOutputStreamwhere data to be stored can be written to.Storagestore(java.io.InputStream in)Stores the contents of the givenInputStream.
-
-
-
Method Detail
-
store
Storage store(java.io.InputStream in) throws java.io.IOException
Stores the contents of the givenInputStream.- 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.
-
createStorageOutputStream
StorageOutputStream createStorageOutputStream() throws java.io.IOException
Creates aStorageOutputStreamwhere data to be stored can be written to. Subsequently the user can calltoStorage()on that object to get aStorageinstance that holds the data that has been written.- Returns:
- a
StorageOutputStreamwhere data can be written to. - Throws:
java.io.IOException- if an I/O error occurs.
-
-