|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.james.mime4j.storage.AbstractStorageProvider
org.apache.james.mime4j.storage.TempFileStorageProvider
public class TempFileStorageProvider
A StorageProvider that stores the data in temporary files. The files
are stored either in a user-specified directory or the default temporary-file
directory (specified by system property java.io.tmpdir).
Example usage:
File directory = new File("/tmp/mime4j");
StorageProvider provider = new TempFileStorageProvider(directory);
DefaultStorageProvider.setInstance(provider);
| Constructor Summary | |
|---|---|
TempFileStorageProvider()
Equivalent to using constructor TempFileStorageProvider("m4j", null, null). |
|
TempFileStorageProvider(java.io.File directory)
Equivalent to using constructor TempFileStorageProvider("m4j", null, directory). |
|
TempFileStorageProvider(java.lang.String prefix,
java.lang.String suffix,
java.io.File directory)
Creates a new TempFileStorageProvider using the given
values. |
|
| Method Summary | |
|---|---|
StorageOutputStream |
createStorageOutputStream()
Creates a StorageOutputStream where data to be stored can be
written to. |
| Methods inherited from class org.apache.james.mime4j.storage.AbstractStorageProvider |
|---|
store |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TempFileStorageProvider()
TempFileStorageProvider("m4j", null, null).
public TempFileStorageProvider(java.io.File directory)
TempFileStorageProvider("m4j", null, directory).
public TempFileStorageProvider(java.lang.String prefix,
java.lang.String suffix,
java.io.File directory)
TempFileStorageProvider using the given
values.
prefix - prefix for generating the temporary file's name; must be at
least three characters long.suffix - suffix for generating the temporary file's name; may be
null to use the suffix ".tmp".directory - the directory in which the file is to be created, or
null if the default temporary-file directory is
to be used (specified by the system property
java.io.tmpdir).
java.lang.IllegalArgumentException - if the given prefix is less than three characters long or the
given directory does not exist and cannot be created (if it
is not null).| Method Detail |
|---|
public StorageOutputStream createStorageOutputStream()
throws java.io.IOException
StorageProviderStorageOutputStream where data to be stored can be
written to. Subsequently the user can call
toStorage() on that object to get
a Storage instance that holds the data that has been written.
StorageOutputStream where data can be written to.
java.io.IOException - if an I/O error occurs.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||