org.glassfish.jersey.media.multipart.internal
Class MultiPartReaderClientSide
java.lang.Object
org.glassfish.jersey.media.multipart.internal.MultiPartReaderClientSide
- All Implemented Interfaces:
- javax.ws.rs.ext.MessageBodyReader<MultiPart>
- Direct Known Subclasses:
- MultiPartReaderServerSide
@Consumes(value="multipart/*")
@Singleton
@ConstrainedTo(value=CLIENT)
public class MultiPartReaderClientSide
- extends Object
- implements javax.ws.rs.ext.MessageBodyReader<MultiPart>
MessageBodyReader implementation for MultiPart entities.
- Author:
- Craig McClanahan, Paul Sandoz (paul.sandoz at oracle.com), Michal Gajdos (michal.gajdos at oracle.com)
|
Constructor Summary |
MultiPartReaderClientSide(javax.ws.rs.ext.Providers providers)
Accepts constructor injection of the configuration parameters for this
application. |
|
Method Summary |
boolean |
isReadable(Class<?> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType)
|
MultiPart |
readFrom(Class<MultiPart> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType,
javax.ws.rs.core.MultivaluedMap<String,String> headers,
InputStream stream)
Reads the entire list of body parts from the Input stream, using the
appropriate provider implementation to deserialize each body part's entity. |
protected MultiPart |
readMultiPart(Class<MultiPart> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType,
javax.ws.rs.core.MultivaluedMap<String,String> headers,
InputStream stream)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MultiPartReaderClientSide
public MultiPartReaderClientSide(@Context
javax.ws.rs.ext.Providers providers)
- Accepts constructor injection of the configuration parameters for this
application.
isReadable
public boolean isReadable(Class<?> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType)
- Specified by:
isReadable in interface javax.ws.rs.ext.MessageBodyReader<MultiPart>
readFrom
public MultiPart readFrom(Class<MultiPart> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType,
javax.ws.rs.core.MultivaluedMap<String,String> headers,
InputStream stream)
throws IOException,
javax.ws.rs.WebApplicationException
- Reads the entire list of body parts from the Input stream, using the
appropriate provider implementation to deserialize each body part's entity.
- Specified by:
readFrom in interface javax.ws.rs.ext.MessageBodyReader<MultiPart>
- Parameters:
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.
- Throws:
IOException - if an I/O error occurs.
javax.ws.rs.WebApplicationException - if an HTTP error response needs to be produced (only effective if the response is not
committed yet).
javax.ws.rs.WebApplicationException - if the Content-Disposition header of a multipart/form-data body part cannot be parsed.
readMultiPart
protected MultiPart readMultiPart(Class<MultiPart> type,
Type genericType,
Annotation[] annotations,
javax.ws.rs.core.MediaType mediaType,
javax.ws.rs.core.MultivaluedMap<String,String> headers,
InputStream stream)
throws IOException,
org.jvnet.mimepull.MIMEParsingException
- Throws:
IOException
org.jvnet.mimepull.MIMEParsingException
Copyright © 2007-2014, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.