@Consumes(value="multipart/*") @Singleton @ConstrainedTo(value=CLIENT) public class MultiPartReaderClientSide extends Object implements MessageBodyReader<MultiPart>
MessageBodyReader
implementation for MultiPart
entities.Constructor and Description |
---|
MultiPartReaderClientSide(Providers providers,
javax.inject.Provider<MessageBodyWorkers> messageBodyWorkers)
Accepts constructor injection of the configuration parameters for this
application.
|
Modifier and Type | Method and Description |
---|---|
boolean |
isReadable(Class<?> type,
Type genericType,
Annotation[] annotations,
MediaType mediaType) |
MultiPart |
readFrom(Class<MultiPart> type,
Type genericType,
Annotation[] annotations,
MediaType mediaType,
MultivaluedMap<String,String> headers,
InputStream stream)
Reads the entire list of body parts from the Input stream, using the
appropriate provider implementation to de-serialize each body part's entity.
|
protected MultiPart |
readMultiPart(Class<MultiPart> type,
Type genericType,
Annotation[] annotations,
MediaType mediaType,
MultivaluedMap<String,String> headers,
InputStream stream) |
@Inject public MultiPartReaderClientSide(@Context Providers providers, @Context javax.inject.Provider<MessageBodyWorkers> messageBodyWorkers)
public boolean isReadable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType)
isReadable
in interface MessageBodyReader<MultiPart>
public MultiPart readFrom(Class<MultiPart> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String,String> headers, InputStream stream) throws IOException, WebApplicationException
readFrom
in interface MessageBodyReader<MultiPart>
type
- the class of the object to be read (i.e. MultiPart
.class).genericType
- the type of object to be written.annotations
- annotations on the resource method that returned this object.mediaType
- media type (multipart/*
) of this entity.headers
- mutable map of HTTP headers for the entire response.stream
- output stream to which the entity should be written.IOException
- if an I/O error occurs.WebApplicationException
- If an HTTP error response needs to be produced (only effective if the response
is not
committed yet) or if the Content-Disposition header of a multipart/form-data
body part
cannot be parsed.protected MultiPart readMultiPart(Class<MultiPart> type, Type genericType, Annotation[] annotations, MediaType mediaType, MultivaluedMap<String,String> headers, InputStream stream) throws IOException, org.jvnet.mimepull.MIMEParsingException
IOException
org.jvnet.mimepull.MIMEParsingException
Copyright © 2007-2023, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.