|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.jersey.multipart.impl.MultiPartWriter
public class MultiPartWriter
Provider
MessageBodyWriter
implementation for
MultiPart
entities.
Constructor Summary | |
---|---|
MultiPartWriter(Providers providers)
|
Method Summary | |
---|---|
long |
getSize(MultiPart entity,
Class<?> type,
Type genericType,
Annotation[] annotations,
MediaType mediaType)
Called before writeTo to ascertain the length in bytes of
the serialized form of t . |
boolean |
isWriteable(Class<?> type,
Type genericType,
Annotation[] annotations,
MediaType mediaType)
Ascertain if the MessageBodyWriter supports a particular type. |
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 |
Constructor Detail |
---|
public MultiPartWriter(@Context Providers providers)
Method Detail |
---|
public long getSize(MultiPart entity, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType)
MessageBodyWriter
writeTo
to ascertain the length in bytes of
the serialized form of t
. A non-negative return value is
used in a HTTP Content-Length
header.
getSize
in interface MessageBodyWriter<MultiPart>
entity
- the instance to writetype
- the class of object that is to be written.genericType
- the type of object to be written, obtained either
by reflection of a resource method return type or by inspection
of the returned instance. GenericEntity
provides a way to specify this information at runtime.annotations
- an array of the annotations on the resource
method that returns the object.mediaType
- the media type of the HTTP entity.
public boolean isWriteable(Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType)
MessageBodyWriter
isWriteable
in interface MessageBodyWriter<MultiPart>
type
- the class of object that is to be written.genericType
- the type of object to be written, obtained either
by reflection of a resource method return type or via inspection
of the returned instance. GenericEntity
provides a way to specify this information at runtime.annotations
- an array of the annotations on the resource
method that returns the object.mediaType
- the media type of the HTTP entity.
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.
writeTo
in interface MessageBodyWriter<MultiPart>
entity
- The MultiPart
instance to writetype
- The class of the object to be written (i.e. MultiPart
.class)genericType
- The type of object to be writtenannotations
- Annotations on the resource method that returned this objectmediaType
- Media type (multipart/*
) of this entityheaders
- Mutable map of HTTP headers for the entire responsestream
- Output stream to which the entity should be written
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)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |