Package org.apache.james.mime4j.storage
Class TempFileStorageProvider.TempFileStorage
- java.lang.Object
-
- org.apache.james.mime4j.storage.TempFileStorageProvider.TempFileStorage
-
- All Implemented Interfaces:
Storage
- Enclosing class:
- TempFileStorageProvider
private static final class TempFileStorageProvider.TempFileStorage extends java.lang.Object implements Storage
-
-
Field Summary
Fields Modifier and Type Field Description private java.io.File
file
private static java.util.Set<java.io.File>
filesToDelete
-
Constructor Summary
Constructors Constructor Description TempFileStorage(java.io.File file)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
delete()
Deletes the data held by thisStorage
as soon as possible.java.io.InputStream
getInputStream()
Returns anInputStream
that can be used to read the stored data.
-
-
-
Method Detail
-
delete
public void delete()
Description copied from interface:Storage
Deletes the data held by thisStorage
as soon as possible. Deleting an already deletedStorage
has no effect.
-
getInputStream
public java.io.InputStream getInputStream() throws java.io.IOException
Description copied from interface:Storage
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.- Specified by:
getInputStream
in interfaceStorage
- Returns:
- an
InputStream
for reading the stored data. - Throws:
java.io.IOException
- if an I/O error occurs.
-
-