How can I get the request attachment when using RESTEasy and multipart provider?

Solution Verified - Updated -

Issue

We have a RESTful WEB Service that receives a multipart attribute, for example:

            @POST
            @Consumes (MediaType.MULTIPART_FORM_DATA)
            @Produces (MediaType.MULTIPART_FORM_DATA)
            @Path ("/resteasy/attachments")
            public Response handleRequest (MultipartInput input) throws Exception {
                 List<InputPart> inputParts = input.getParts();
                 //...
            }

How can we retrieve the HTTP request attachment using it?

Environment

  • RESTEasy 1.2.1
  • JBoss Enterprise Application Platform (EAP) 5.x

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase of over 48,000 articles and solutions.

Current Customers and Partners

Log in for full access

Log In
Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.