users@jersey.java.net

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

From: <pallipp_at_gmail.com>
Date: Wed, 21 Sep 2011 10:05:07 +0000 (GMT)

Howdy!

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].

Cheers!

Pedro

[1] -
http://jersey.java.net/nonav/apidocs/1.9.1/contribs/jersey-multipart/co
m/sun/jersey/multipart/file/FileDataBodyPart.html
[2] - https://issues.jboss.org/browse/ARQ-569