Package org.jvnet.mimepull
Class MIMEConfig
- java.lang.Object
-
- org.jvnet.mimepull.MIMEConfig
-
public class MIMEConfig extends java.lang.Object
Configuration for MIME message parsing and storing.
-
-
Field Summary
Fields Modifier and Type Field Description (package private) int
chunkSize
private static int
DEFAULT_CHUNK_SIZE
private static java.lang.String
DEFAULT_FILE_PREFIX
private static long
DEFAULT_MEMORY_THRESHOLD
private static java.util.logging.Logger
LOGGER
(package private) long
memoryThreshold
(package private) boolean
parseEagerly
(package private) java.lang.String
prefix
(package private) java.lang.String
suffix
(package private) java.io.File
tempDir
-
Constructor Summary
Constructors Modifier Constructor Description MIMEConfig()
private
MIMEConfig(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) int
getChunkSize()
(package private) long
getMemoryThreshold()
(package private) java.io.File
getTempDir()
(package private) java.lang.String
getTempFilePrefix()
(package private) java.lang.String
getTempFileSuffix()
(package private) boolean
isOnlyMemory()
(package private) boolean
isParseEagerly()
(package private) void
setChunkSize(int chunkSize)
void
setDir(java.lang.String directory)
void
setMemoryThreshold(long memoryThreshold)
If the attachment is greater than the threshold, it is written to the disk.void
setParseEagerly(boolean parseEagerly)
void
validate()
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)
-
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.
-
-