Skip to main content

Jersey and unknown number of uploads

No replies
Joined: 2012-02-27

I am writing a jersey REST service, and one of my operations could have multiple binaries uploaded with it. I see example on how to use parameter annotation to get a known attachment part into an InputStream parameter, and evne how to make it optional via a required=false. The difference is that I won't know how many attachments or what their names/types will be before I am invoked. I see UriInfo to getQueryParameters, but that returns a map<string, string>. I need a getAttachments() that returns map<String, Attachment> or something along those lines so that i can iterate the list and process each in turn, detecting their name and mime type as i go.

How does one do this in Jersey?