Uploaded image for project: 'James Mime4j'
  1. James Mime4j
  2. MIME4J-83

Add a more generic machanism for storing message bodies



    • New Feature
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.5
    • 0.6
    • None
    • None


      Currently Mime4j uses TempStorage, TempPath and TempFile to store the contents of a text or binary body of a message. While this design allows for TempStorage to be replaced with a custom implementation it does not seem to be generic enough.

      A TempStorage implementation may choose to keep the data in memory but it still has to deal with things like file name prefixes/suffixes or creating subdirectories. The entire interface TempPath and many methods in TempFile seem to be unnecessary.

      Also while an application can configure what TempStorage instance it wants to use (by means of a system property and a static setInstance method) there is no way to inject a TempStorage instance into a MessageBuilder.

      An alternative storage mechanism should be simpler and more generic. It should be possible to provide implementations that store the data in memory or on disk in the system's temp folder for example. Other implementations could keep the data in memory as long as a certain threshold size does not get exceeded or use a specific folder on disk to store the files.


        1. mime4j-storageprovider.patch
          52 kB
          Markus Wiederkehr

        Issue Links



              Unassigned Unassigned
              wmax Markus Wiederkehr
              0 Vote for this issue
              0 Start watching this issue