users@jsr311.java.net

Re: Support for multipart MIME types in JAX-RS

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Fri, 15 Aug 2008 11:00:56 -0400

On Aug 14, 2008, at 6:58 PM, Craig McClanahan wrote:

> I'm currently evaluating a proposed API that uses the multipart/
> mixed content type to allow metadata about an object (in XML or
> JSON) as one body subpart, and the object itself (typically in some
> binary format) as a second body part. I don't see anything in the
> current spec that would help me deal with this. Has there been any
> thinking about this, at either the spec or the RI level?
>
At the spec level we added the ability for a provider to locate other
providers via the Providers interface. It should be possible to write
a composite message body reader/writer using this.

IIRC, Jersey supports use of JavaMail for working with multipart data
but I don't recall whether multipart/mixed is supported or multipart/
related or perhaps both.

HTH,
Marc.

> For processing inbound things like my use case, a provider for
> multipart/mixed that then (recursively, because you could
> theoretically nest a multipart/mixed subpart) figured out the
> correct provider for each body subpart, then gave me back some sort
> of data structure that allowed access to the individual parts would
> be quite cool. For output, the reverse transformation (pass in a
> set of entities and associated content types, and the right
> providers would be called for each entity) would also be useful.
>
> Craig
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jsr311.dev.java.net
> For additional commands, e-mail: users-help_at_jsr311.dev.java.net
>

---
Marc Hadley <marc.hadley at sun.com>
CTO Office, Sun Microsystems.