org.glassfish.jersey.media.multipart.internal
Class MultiPartWriter
java.lang.Object
org.glassfish.jersey.media.multipart.internal.MultiPartWriter
- All Implemented Interfaces:
- MessageBodyWriter<MultiPart>
@Singleton
public class MultiPartWriter
- extends Object
- implements MessageBodyWriter<MultiPart>
Provider MessageBodyWriter implementation for MultiPart entities.
- Author:
- Craig McClanahan, Paul Sandoz (paul.sandoz at oracle.com), Michal Gajdos (michal.gajdos at oracle.com)
|
Method Summary |
long |
getSize(MultiPart entity,
Class<?> type,
Type genericType,
Annotation[] annotations,
MediaType mediaType)
|
boolean |
isWriteable(Class<?> type,
Type genericType,
Annotation[] annotations,
MediaType mediaType)
|
void |
writeTo(MultiPart entity,
Class<?> type,
Type genericType,
Annotation[] annotations,
MediaType mediaType,
MultivaluedMap<String,Object> headers,
OutputStream stream)
Write the entire list of body parts to the output stream, using the
appropriate provider implementation to serialize each body part's entity. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
MultiPartWriter
public MultiPartWriter(@Context
Providers providers)
getSize
public long getSize(MultiPart entity,
Class<?> type,
Type genericType,
Annotation[] annotations,
MediaType mediaType)
- Specified by:
getSize in interface MessageBodyWriter<MultiPart>
isWriteable
public boolean isWriteable(Class<?> type,
Type genericType,
Annotation[] annotations,
MediaType mediaType)
- Specified by:
isWriteable in interface MessageBodyWriter<MultiPart>
writeTo
public void writeTo(MultiPart entity,
Class<?> type,
Type genericType,
Annotation[] annotations,
MediaType mediaType,
MultivaluedMap<String,Object> headers,
OutputStream stream)
throws IOException,
WebApplicationException
- Write the entire list of body parts to the output stream, using the
appropriate provider implementation to serialize each body part's entity.
- Specified by:
writeTo in interface MessageBodyWriter<MultiPart>
- Parameters:
entity - the MultiPart instance to write.type - the class of the object to be written (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.
WebApplicationException - if an HTTP error response
needs to be produced (only effective if the response is not committed yet).
Copyright © 2007-2013 Oracle Corporation. All Rights Reserved. Use is subject to license terms.