Class MultiPartWriter
- java.lang.Object
-
- org.glassfish.jersey.media.multipart.internal.MultiPartWriter
-
-
Field Summary
Fields Modifier and Type Field Description private static java.lang.annotation.Annotation[]EMPTY_ANNOTATIONSprivate javax.ws.rs.ext.ProvidersprovidersInjectable helper to look up appropriateProviders for our body parts.
-
Constructor Summary
Constructors Constructor Description MultiPartWriter(javax.ws.rs.ext.Providers providers)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description longgetSize(MultiPart entity, java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)booleanisWriteable(java.lang.Class<?> type, java.lang.reflect.Type genericType, java.lang.annotation.Annotation[] annotations, javax.ws.rs.core.MediaType mediaType)voidwriteTo(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.
-
-
-
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:
getSizein interfacejavax.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:
isWriteablein interfacejavax.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:
writeToin interfacejavax.ws.rs.ext.MessageBodyWriter<MultiPart>- Parameters:
entity- theMultiPartinstance 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).
-
-