users@jersey.java.net

[Jersey] MediaType.MULTIPART_FORM_DATA_TYPE?

From: Ed Anuff <ed_at_anuff.com>
Date: Wed, 15 Dec 2010 16:24:34 -0800

Looking at the example from here:

http://jersey.java.net/nonav/apidocs/1.4/contribs/jersey-multipart/com/sun/jersey/multipart/FormDataParam.html

@Consumes(MediaType.MULTIPART_FORM_DATA_TYPE)
public String postForm(
        @DefaultValue("true") @FormDataParam("enabled") boolean enabled,
        @FormDataParam("data") FileData bean,
        @FormDataParam("file") InputStream file,
        @FormDataParam("file") FormDataContentDisposition fileDisposition) {
    ...
}

Using MediaType.MULTIPART_FORM_DATA_TYPE won't compile, since it's of type
MediaType and @Consumes expects a String[]. However,
MediaType.MULTIPART_FORM_DATA does work. Is that what I should be using?

Thanks

Ed