users@jersey.java.net

Changing jersey-multipart to not use JavaMail

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Mon, 16 Mar 2009 11:34:22 +0100

Hi,

When using jersey-multipart we are getting out of memory issues
because JavaMail buffers [1].

I have been looking at the MIMEPull API [2]. It is a clean and simple
API that supports pull-based streaming of body parts (if accessed in
the serialized order) or buffering to disk.

Craig has also proposed using Mime4J [3]. This API is a push-based
streaming API, e.g. like SAX where as MIMEPull is like StAX. The last
stable release of Mime4j is version 0.6

 From a quick look at both APIs i prefer the pull model of MIMEPull
rather than the push model of Mime4J. The former makes it much easier
to integrate into the existing code base.

In addition to switching from JavaMail for parsing i propose that
while we do that work we implement support for @FormDataParam for
getting access to MIME body parts and deprecate the use of @FormParam.

Paul.

[1] https://jersey.dev.java.net/issues/show_bug.cgi?id=238

[2] https://mimepull.dev.java.net/

[3] http://james.apache.org/mime4j/