users@jersey.java.net

Re: [Jersey] Re: Multipart Post

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Tue, 16 Mar 2010 09:04:21 +0100

Hi Steve,

Glad you found a way to solve this, since this is particular tricky to
override.

IMHO i would also try and log an issue against RoR.

Paul.

On Mar 16, 2010, at 8:18 AM, sshapero wrote:

>
> Hi Paul
>
> I decided to change strategies and wrote an implementation of
> MessageBodyWriter and created MyMultiPart to go with it. While going
> against what I know to be best practices, the former is just a copy
> of the
> standard MultiPartWriter, while the ladder extends
> FormDataMultiPart. I
> added this crass bit to MyMultiPartWriter.writeTo to solve my issue:
>
> String hackedContentDisposition =
> bodyPart.getContentDisposition().toString();
> hackedContentDisposition =
> hackedContentDisposition.replace(";name", ";
> name");
> bodyHeaders.putSingle("Content-Disposition",
> hackedContentDisposition);
>
> Horrid I know but it gets 'er done. I didn't quite grasp how I
> could use
> the BAOS to avoid doing what I did. I feel ok about it, as we are
> going to
> change the architecture down the road to eliminate the need for this
> particular service end point (hahahaha I know famous last words).
>
> Thanks for taking the time to read my post and help out, it is
> sincerely
> appreciated. We've invested a lot of time in using the jersey client
> libraries so I'm happy we found a way to work it out.
>
> Thanks again
> Steve
> --
> View this message in context: http://n2.nabble.com/Multipart-Post-tp4252846p4742164.html
> Sent from the Jersey mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jersey.dev.java.net
> For additional commands, e-mail: users-help_at_jersey.dev.java.net
>