Hi
On 07/08/14 23:59, Francisco Moraes wrote:
Hi,

I am trying to convert a project that used Wink to CXF. It all works
great but I had a problem with a file upload form that was using Wink
specific classes to handle multipart form data. I can make it all work
using MultipartBody but that would tie the solution to CXF.

I found the following two posts but neither seemed to work for me:

http://stackoverflow.com/questions/20456243/how-can-i-define-a-jax-rs-service-that-processes-multi-part-data-in-jee

http://blogs.steeplesoft.com/posts/2014/05/01/file-uploads-with-jax-rs-2/

The HttpServletRequest received has an empty getParts().

Is this possible to do or do I have to use MultipartBody?

The only portable way to get multiparts processed in JAX-RS is to
have InputStream in the singature and then delegate to the 3-rd party library of choice. To be honest the difference it is a very thin line between 'tying to the CXF MultipartBody' and 'tying to some 3rd party library'. IMHO CXF Attachments support is good (starting from the core level in the way it deals with caching the streams, etc). But it is up to you how to deal with it :-)

Cheers, Sergey

Thanks.

Francisco


Reply via email to