Class MultiPart
java.lang.Object
org.glassfish.jersey.media.multipart.BodyPart
org.glassfish.jersey.media.multipart.MultiPart
- All Implemented Interfaces:
 Closeable,AutoCloseable
- Direct Known Subclasses:
 FormDataMultiPart
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.- Author:
 - Craig McClanahan, Paul Sandoz, Michal Gajdos
 
- 
Field Summary
Fields inherited from class org.glassfish.jersey.media.multipart.BodyPart
contentDisposition, messageBodyWorkers - 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionvoidcleanup()Performs any necessary cleanup at the end of processing thisMultiPart.voidclose()Override the entity set operation on aMultiPartto throwIllegalArgumentException.Disables access to the entity for aMultiPart.voidDisables access to the entity for aMultiPart.voidsetMediaType(MediaType mediaType) Builder pattern method to return thisMultiPartafter additional configuration.Methods inherited from class org.glassfish.jersey.media.multipart.BodyPart
contentDisposition, getContentDisposition, getEntityAs, getHeaders, getMediaType, getParameterizedHeaders, getParent, getProviders, setContentDisposition, setMessageBodyWorkers, setParent, setProviders 
- 
Constructor Details
 - 
Method Details
- 
getBodyParts
 - 
getEntity
Disables access to the entity for aMultiPart. Use the list returned bygetBodyParts()to access the relevantBodyPartinstead.- Overrides:
 getEntityin classBodyPart- Returns:
 - an entity of this body part.
 - Throws:
 IllegalStateException- thrown unconditionally.
 - 
setEntity
 - 
setMediaType
- Overrides:
 setMediaTypein classBodyPart- Parameters:
 mediaType- the newMediaType.- Throws:
 IllegalArgumentException- if thetypeproperty is not set tomultipart.
 - 
bodyPart
- Parameters:
 bodyPart-BodyPartto be added.
 - 
bodyPart
- Parameters:
 entity- entity object for this body part.mediaType- content type for this body part.
 - 
entity
Override the entity set operation on aMultiPartto throwIllegalArgumentException. - 
type
Builder pattern method to return thisMultiPartafter additional configuration. - 
cleanup
public void cleanup()Performs any necessary cleanup at the end of processing thisMultiPart. - 
close
- Specified by:
 closein interfaceAutoCloseable- Specified by:
 closein interfaceCloseable- Throws:
 IOException
 
 -