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