Class MIMEConfig


  • public class MIMEConfig
    extends java.lang.Object
    Configuration for MIME message parsing and storing.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
        MIMEConfig()
      Create new 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)
      Sets whether message should be parsed eagerly.
      void validate()
      Validates if it can create temporary files.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • 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
    • Constructor Detail

      • MIMEConfig

        private MIMEConfig​(boolean parseEagerly,
                           int chunkSize,
                           long inMemoryThreshold,
                           java.lang.String dir,
                           java.lang.String prefix,
                           java.lang.String suffix)
      • MIMEConfig

        public MIMEConfig()
        Create new MIMEConfig
    • 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.