@Provider public class MultipartPayloadProvider extends Object implements javax.ws.rs.ext.MessageBodyReader<MultipartFormData>
Provides a MessageBodyReader
for MultipartFormData
. This allows writing resources which
consume MediaType.MULTIPART_FORM_DATA
which is parsed into a MultipartFormData
object:
@POST @Consumes(MediaType.MULTIPART_FORM_DATA) void handleMultipartPost(MultipartFormData multipartFormData);
The implementation used apache commons fileupload in order to parse the request and populate an instance of
MultipartFormData
.
Modifier and Type | Field and Description |
---|---|
static String |
SUB_TYPE_NAME |
static String |
TYPE_NAME |
Constructor and Description |
---|
MultipartPayloadProvider() |
Modifier and Type | Method and Description |
---|---|
protected org.apache.commons.fileupload.FileUpload |
createFileUploadInstance() |
protected MultipartFormData |
createMultipartFormDataInstance() |
protected org.camunda.bpm.engine.rest.mapper.MultipartPayloadProvider.RestMultipartRequestContext |
createRequestContext(InputStream entityStream,
String contentType) |
boolean |
isReadable(Class<?> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType) |
protected void |
parseRequest(MultipartFormData multipartFormData,
org.apache.commons.fileupload.FileUpload fileUpload,
org.camunda.bpm.engine.rest.mapper.MultipartPayloadProvider.RestMultipartRequestContext requestContext) |
MultipartFormData |
readFrom(Class<MultipartFormData> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType,
javax.ws.rs.core.MultivaluedMap<String,String> httpHeaders,
InputStream entityStream) |
public static final String TYPE_NAME
public static final String SUB_TYPE_NAME
public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
isReadable
in interface javax.ws.rs.ext.MessageBodyReader<MultipartFormData>
public MultipartFormData readFrom(Class<MultipartFormData> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String,String> httpHeaders, InputStream entityStream) throws IOException, javax.ws.rs.WebApplicationException
readFrom
in interface javax.ws.rs.ext.MessageBodyReader<MultipartFormData>
IOException
javax.ws.rs.WebApplicationException
protected org.apache.commons.fileupload.FileUpload createFileUploadInstance()
protected MultipartFormData createMultipartFormDataInstance()
protected void parseRequest(MultipartFormData multipartFormData, org.apache.commons.fileupload.FileUpload fileUpload, org.camunda.bpm.engine.rest.mapper.MultipartPayloadProvider.RestMultipartRequestContext requestContext)
protected org.camunda.bpm.engine.rest.mapper.MultipartPayloadProvider.RestMultipartRequestContext createRequestContext(InputStream entityStream, String contentType)
Copyright © 2019. All rights reserved.