I've got my simple form-based example working now, where my POST method
receives the multipart MIME message. Looking over the problem, I think what
would be _really_ cool would be another Param annotation, FieldParam.
What I expected initially was that I could do something like this:
@POST
@Path("upload")
@FormData
public void uploadGraphML(
@FieldParam(name="graphml",type="application/xml") GraphML graphML,
@FieldParam(name="owner") String ownerName
) {
}
Sure, I'd like Jersey to just do everything for me ;) Marking @FormData
tells Jersey that that form data from a post is inbound, so it knows to
break those into named fields. The @FieldParam tells Jersey the name and
mime type of the field within the multipart MIME data. It can then perform
its normal data conversion steps to get from there to the type of the field
(in this case I have a JAXB context defined for GraphML). For each parameter
the process is repeated, locating the appropriate field on the inbound
message and converting it.
I've got what I need working, but there's a certain elegance (not to mention
great ease of use) to the scheme outlined above...
RJ