Package org.apache.james.mime4j.storage
Interface Storage
- All Known Implementing Classes:
CipherStorageProvider.CipherStorage
,MemoryStorageProvider.MemoryStorage
,MultiReferenceStorage
,TempFileStorageProvider.TempFileStorage
,ThresholdStorageProvider.ThresholdStorage
public interface Storage
Can be used to read data that has been stored by a
StorageProvider
.-
Method Summary
Modifier and TypeMethodDescriptionvoid
delete()
Deletes the data held by thisStorage
as soon as possible.Returns anInputStream
that can be used to read the stored data.
-
Method Details
-
getInputStream
Returns anInputStream
that can be used to read the stored data. The input stream should be closed by the caller when it is no longer needed.Note: The stream should NOT be wrapped in a
BufferedInputStream
by the caller. If the implementingStorage
creates a stream which would benefit from being buffered it is theStorage
's responsibility to wrap it.- Returns:
- an
InputStream
for reading the stored data. - Throws:
IOException
- if an I/O error occurs.IllegalStateException
- if thisStorage
instance has been deleted.
-
delete
void delete()Deletes the data held by thisStorage
as soon as possible. Deleting an already deletedStorage
has no effect.
-