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

Add a more generic machanism for storing message bodies

    XMLWordPrintableJSON

Details

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

    Description

      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.

      Attachments

        1. mime4j-storageprovider.patch
          52 kB
          Markus Wiederkehr

        Issue Links

          Activity

            People

              Unassigned Unassigned
              wmax Markus Wiederkehr
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: