[Jersey] Re: Support for byte[] in com.sun.jersey.multipart.file.FileDataBodyPart

From: Palli <>
Date: Fri, 30 Sep 2011 00:34:27 +0200

I've attached the patch to the JIRA:
It adds the support for sending InputStream as a multipart/form-data body part entity, which I think is more adequate and still can be used for byte[] with ByteArrayInputStream.

Can anyone take a look if it's acceptable?


On 09/21/2011 07:41 PM, Jakub Podlesak wrote:
Thanks. Looking forward to your contribution.
Please keep the list posted if you have any question.


On 21.9.2011 18:09, Palli wrote:
Hi Jakub,

Great, there is a JIRA for this enhancement:

As soon as I'll be able I'll take a look at it, as I'm quite fancy getting known Jersey :-)



On 09/21/2011 02:46 PM, Jakub Podlesak wrote:
Hi Pedro,

+1 for the 2. option.

And yes, contributions are warmly welcome.
Please file a RFE, and attach a patch there.



On 21.9.2011 12:05, wrote:

I think it would be nice if we could have an additional support for
byte[] instead of just flat File objects in FormDataBodyPart. I think
there are situations in which we don't need to hit the disk before
sending the data through the wire (or do we?)

According to the javadoc [1] there is only a File object support.

If you agree that such feature is acceptable, than I think that either:
1. The FileDataBodyPart should be adjusted to support byte[] or,
2. Another subclass of FormDataBodyPart should be created which will
support the byte[].

Personally, I'd prefer the 2. option.

What do you think about that?
Are you open for contributions?

The idea for this feature was born in Arquillian project [2].



[1] -
[2] -