Class MultiPartWriter
java.lang.Object
org.glassfish.jersey.media.multipart.internal.MultiPartWriter
- All Implemented Interfaces:
javax.ws.rs.ext.MessageBodyWriter<MultiPart>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Annotation[]private final javax.ws.rs.ext.ProvidersInjectable helper to look up appropriateProviders for our body parts. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionlonggetSize(MultiPart entity, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType) booleanisWriteable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType) voidwriteTo(MultiPart entity, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.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.
-
Field Details
-
EMPTY_ANNOTATIONS
-
providers
private final javax.ws.rs.ext.Providers providersInjectable helper to look up appropriateProviders for our body parts.
-
-
Constructor Details
-
MultiPartWriter
public MultiPartWriter(@Context javax.ws.rs.ext.Providers providers)
-
-
Method Details
-
getSize
public long getSize(MultiPart entity, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType) - Specified by:
getSizein interfacejavax.ws.rs.ext.MessageBodyWriter<MultiPart>
-
isWriteable
public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType) - Specified by:
isWriteablein interfacejavax.ws.rs.ext.MessageBodyWriter<MultiPart>
-
writeTo
public void writeTo(MultiPart entity, Class<?> type, Type genericType, Annotation[] annotations, javax.ws.rs.core.MediaType mediaType, javax.ws.rs.core.MultivaluedMap<String, Object> headers, OutputStream stream) throws IOException, javax.ws.rs.WebApplicationExceptionWrite 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:
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).
-