- java.lang.Object
-
- org.jvnet.mimepull.MIMEConfig
-
public class MIMEConfig extends java.lang.ObjectConfiguration for MIME message parsing and storing.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) intchunkSizeprivate static intDEFAULT_CHUNK_SIZEprivate static java.lang.StringDEFAULT_FILE_PREFIXprivate static longDEFAULT_MEMORY_THRESHOLDprivate static java.util.logging.LoggerLOGGER(package private) longmemoryThreshold(package private) booleanparseEagerly(package private) java.lang.Stringprefix(package private) java.lang.Stringsuffix(package private) java.io.FiletempDir
-
Constructor Summary
Constructors Modifier Constructor Description MIMEConfig()Create new MIMEConfigprivateMIMEConfig(boolean parseEagerly, int chunkSize, long inMemoryThreshold, java.lang.String dir, java.lang.String prefix, java.lang.String suffix)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) intgetChunkSize()(package private) longgetMemoryThreshold()(package private) java.io.FilegetTempDir()(package private) java.lang.StringgetTempFilePrefix()(package private) java.lang.StringgetTempFileSuffix()(package private) booleanisOnlyMemory()(package private) booleanisParseEagerly()(package private) voidsetChunkSize(int chunkSize)voidsetDir(java.lang.String directory)voidsetMemoryThreshold(long memoryThreshold)If the attachment is greater than the threshold, it is written to the disk.voidsetParseEagerly(boolean parseEagerly)Sets whether message should be parsed eagerly.voidvalidate()Validates if it can create temporary files.
-
-
-
Field Detail
-
DEFAULT_CHUNK_SIZE
private static final int DEFAULT_CHUNK_SIZE
- See Also:
- Constant Field Values
-
DEFAULT_MEMORY_THRESHOLD
private static final long DEFAULT_MEMORY_THRESHOLD
- See Also:
- Constant Field Values
-
DEFAULT_FILE_PREFIX
private static final java.lang.String DEFAULT_FILE_PREFIX
- See Also:
- Constant Field Values
-
LOGGER
private static final java.util.logging.Logger LOGGER
-
parseEagerly
boolean parseEagerly
-
chunkSize
int chunkSize
-
memoryThreshold
long memoryThreshold
-
tempDir
java.io.File tempDir
-
prefix
java.lang.String prefix
-
suffix
java.lang.String suffix
-
-
Method Detail
-
isParseEagerly
boolean isParseEagerly()
-
setParseEagerly
public void setParseEagerly(boolean parseEagerly)
Sets whether message should be parsed eagerly.- Parameters:
parseEagerly- true if to parse eagerly
-
getChunkSize
int getChunkSize()
-
setChunkSize
void setChunkSize(int chunkSize)
-
getMemoryThreshold
long getMemoryThreshold()
-
setMemoryThreshold
public void setMemoryThreshold(long memoryThreshold)
If the attachment is greater than the threshold, it is written to the disk.- Parameters:
memoryThreshold- no of bytes per attachment if -1, then the whole attachment is kept in memory
-
isOnlyMemory
boolean isOnlyMemory()
-
getTempDir
java.io.File getTempDir()
-
getTempFilePrefix
java.lang.String getTempFilePrefix()
-
getTempFileSuffix
java.lang.String getTempFileSuffix()
-
setDir
public final void setDir(java.lang.String directory)
- Parameters:
directory- temp directory
-
validate
public void validate()
Validates if it can create temporary files. Otherwise, it stores attachment contents in memory.
-
-