@Provider @Produces(value="multipart/mixed") @Consumes(value={"multipart/mixed","multipart/form-data"}) public class MimeMultipartProvider extends AbstractEntityProvider<MimeMultipart>
MimeMultipart
as a method
parameter or a return value and theConstructor and Description |
---|
MimeMultipartProvider() |
Modifier and Type | Method and Description |
---|---|
boolean |
isReadable(Class<?> type,
Type genericType,
Annotation[] annotations,
MediaType mediaType)
Ascertain if the MessageBodyReader can produce an instance of a
particular type.
|
boolean |
isWriteable(Class<?> type,
Type genericType,
Annotation[] annotations,
MediaType mediaType)
Ascertain if the MessageBodyWriter supports a particular type.
|
static DataSource |
readDataSource(InputStream in,
MediaType mediaType) |
MimeMultipart |
readFrom(Class<MimeMultipart> type,
Type genericType,
Annotation[] annotations,
MediaType mediaType,
MultivaluedMap<String,String> httpHeaders,
InputStream entityStream)
FIXME Comment this
|
void |
writeTo(MimeMultipart mimeMultipart,
Class<?> type,
Type genericType,
Annotation[] annotations,
MediaType mediaType,
MultivaluedMap<String,Object> httpHeaders,
OutputStream entityStream)
FIXME Comment this
|
getSize
public static DataSource readDataSource(InputStream in, MediaType mediaType) throws IOException
in
- mediaType
- IOException
public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType)
MessageBodyReader
type
parameter gives the
class of the instance that should be produced, the genericType
parameter
gives the java.lang.reflect.Type
of the instance
that should be produced.
E.g. if the instance to be produced is List<String>
, the type
parameter
will be java.util.List
and the genericType
parameter will be
java.lang.reflect.ParameterizedType
.type
- genericType
- annotations
- mediaType
- the media type of the HTTP entity, if one is not
specified in the request then application/octet-stream
is
used.public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType)
MessageBodyWriter
type
- genericType
- annotations
- mediaType
- the media type of the HTTP entity.public MimeMultipart readFrom(Class<MimeMultipart> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String,String> httpHeaders, InputStream entityStream) throws IOException
type
- genericType
- annotations
- mediaType
- httpHeaders
- entityStream
- IOException
WebApplicationException
javax.ws.rs.ext.MessageBodyReader#readFrom(java.lang.Class, java.lang.reflect.Type, java.lang.annotation.Annotation[], javax.ws.rs.core.MediaType, javax.ws.rs.core.MultivaluedMap, java.io.InputStream)
public void writeTo(MimeMultipart mimeMultipart, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String,Object> httpHeaders, OutputStream entityStream) throws IOException
mimeMultipart
- type
- genericType
- annotations
- mediaType
- httpHeaders
- entityStream
- IOException
javax.ws.rs.ext.MessageBodyWriter#writeTo(java.lang.Object, java.lang.Class, java.lang.reflect.Type, java.lang.annotation.Annotation[], javax.ws.rs.core.MediaType, javax.ws.rs.core.MultivaluedMap, java.io.OutputStream)
Copyright © 2016 JBoss by Red Hat. All rights reserved.