com.sun.jersey.multipart.impl
Class MultiPartWriter

java.lang.Object
  extended by com.sun.jersey.multipart.impl.MultiPartWriter
All Implemented Interfaces:
javax.ws.rs.ext.MessageBodyWriter<MultiPart>

public class MultiPartWriter
extends java.lang.Object
implements javax.ws.rs.ext.MessageBodyWriter<MultiPart>

Provider MessageBodyWriter implementation for MultiPart entities.


Constructor Summary
MultiPartWriter(javax.ws.rs.ext.Providers providers)
           
 
Method Summary
 long getSize(MultiPart entity, java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
           
 boolean isWriteable(java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)
           
 void writeTo(MultiPart entity, java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.Object> headers, java.io.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
 

Constructor Detail

MultiPartWriter

public MultiPartWriter(@Context
                       javax.ws.rs.ext.Providers providers)
Method Detail

getSize

public long getSize(MultiPart entity,
                    java.lang.Class<?> type,
                    java.lang.reflect.Type genericType,
                    java.lang.annotation.Annotation[] annotations,
                    javax.ws.rs.core.MediaType mediaType)
Specified by:
getSize in interface javax.ws.rs.ext.MessageBodyWriter<MultiPart>

isWriteable

public boolean isWriteable(java.lang.Class<?> type,
                           java.lang.reflect.Type genericType,
                           java.lang.annotation.Annotation[] annotations,
                           javax.ws.rs.core.MediaType mediaType)
Specified by:
isWriteable in interface javax.ws.rs.ext.MessageBodyWriter<MultiPart>

writeTo

public void writeTo(MultiPart entity,
                    java.lang.Class<?> type,
                    java.lang.reflect.Type genericType,
                    java.lang.annotation.Annotation[] annotations,
                    javax.ws.rs.core.MediaType mediaType,
                    javax.ws.rs.core.MultivaluedMap<java.lang.String,java.lang.Object> headers,
                    java.io.OutputStream stream)
             throws java.io.IOException,
                    javax.ws.rs.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 javax.ws.rs.ext.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:
java.io.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)


Copyright © 2011 Sun Microsystems, Inc. All Rights Reserved.