|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.jersey.multipart.BodyPart
com.sun.jersey.multipart.MultiPart
public class MultiPart
A mutable model representing a MIME MultiPart entity. This class extends
BodyPart
because MultiPart entities can be nested inside other
MultiPart entities to an arbitrary depth.
Field Summary |
---|
Fields inherited from class com.sun.jersey.multipart.BodyPart |
---|
cd |
Constructor Summary | |
---|---|
MultiPart()
Instantiate a new MultiPart with a mediaType of
multipart/mixed . |
|
MultiPart(MediaType mediaType)
Instantiate a new MultiPart with the specified characteristics. |
Method Summary | |
---|---|
MultiPart |
bodyPart(BodyPart bodyPart)
Builder pattern method to add the specified BodyPart to this
MultiPart . |
MultiPart |
bodyPart(java.lang.Object entity,
MediaType mediaType)
Builder pattern method to add a newly configured BodyPart
to this MultiPart . |
void |
cleanup()
Perform any necessary cleanup at the end of processing this MultiPart . |
void |
close()
|
BodyPart |
entity(java.lang.Object entity)
Override the entity set operation on a MultiPart to throw
IllegalArgumentException . |
java.util.List<BodyPart> |
getBodyParts()
Return a mutable list of BodyPart s nested in this
MultiPart . |
java.lang.Object |
getEntity()
Disable access to the entity for a MultiPart . |
void |
setEntity(java.lang.Object entity)
Disable access to the entity for a MultiPart . |
void |
setMediaType(MediaType mediaType)
Set the MediaType for this MultiPart . |
MultiPart |
type(MediaType type)
Builder pattern method to return this MultiPart after
additional configuration. |
Methods inherited from class com.sun.jersey.multipart.BodyPart |
---|
contentDisposition, getContentDisposition, getEntityAs, getHeaders, getMediaType, getParameterizedHeaders, getParent, getProviders, setContentDisposition, setParent, setProviders |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MultiPart()
Instantiate a new MultiPart
with a mediaType
of
multipart/mixed
.
public MultiPart(MediaType mediaType)
Instantiate a new MultiPart
with the specified characteristics.
mediaType
- The MediaType
for this multipartMethod Detail |
---|
public java.util.List<BodyPart> getBodyParts()
public java.lang.Object getEntity()
Disable access to the entity for a MultiPart
. Use the list
returned by getBodyParts()
to access the relevant
BodyPart
instead.
getEntity
in class BodyPart
java.lang.IllegalStateException
- thrown unconditionallypublic void setEntity(java.lang.Object entity)
Disable access to the entity for a MultiPart
. Use the list
returned by getBodyParts()
to access the relevant
BodyPart
instead.
setEntity
in class BodyPart
entity
- public void setMediaType(MediaType mediaType)
Set the MediaType
for this MultiPart
. If never set,
the default MediaType
MUST be multipart/mixed
.
setMediaType
in class BodyPart
mediaType
- The new MediaType
java.lang.IllegalArgumentException
- if the type
property
is not set to multipart
public MultiPart bodyPart(BodyPart bodyPart)
Builder pattern method to add the specified BodyPart
to this
MultiPart
.
bodyPart
- BodyPart
to be addedpublic MultiPart bodyPart(java.lang.Object entity, MediaType mediaType)
Builder pattern method to add a newly configured BodyPart
to this MultiPart
.
entity
- Entity object for this body partmediaType
- Content type for this body partpublic BodyPart entity(java.lang.Object entity)
Override the entity set operation on a MultiPart
to throw
IllegalArgumentException
.
entity
in class BodyPart
entity
- Entity to set for this BodyPart
public MultiPart type(MediaType type)
Builder pattern method to return this MultiPart
after
additional configuration.
type
in class BodyPart
type
- Media type to set for this MultiPart
public void cleanup()
Perform any necessary cleanup at the end of processing this
MultiPart
.
cleanup
in class BodyPart
public void close() throws java.io.IOException
close
in interface java.io.Closeable
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |