Class MultiPart
- java.lang.Object
-
- org.glassfish.jersey.media.multipart.BodyPart
-
- org.glassfish.jersey.media.multipart.MultiPart
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable
- Direct Known Subclasses:
FormDataMultiPart
public class MultiPart extends BodyPart implements java.io.Closeable
A mutable model representing a MIME MultiPart entity. This class extendsBodyPartbecause MultiPart entities can be nested inside other MultiPart entities to an arbitrary depth.
-
-
Field Summary
Fields Modifier and Type Field Description private BodyPartsListbodyParts-
Fields inherited from class org.glassfish.jersey.media.multipart.BodyPart
contentDisposition, messageBodyWorkers
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MultiPartbodyPart(java.lang.Object entity, javax.ws.rs.core.MediaType mediaType)MultiPartbodyPart(BodyPart bodyPart)voidcleanup()Performs any necessary cleanup at the end of processing thisMultiPart.voidclose()BodyPartentity(java.lang.Object entity)Override the entity set operation on aMultiPartto throwIllegalArgumentException.java.util.List<BodyPart>getBodyParts()java.lang.ObjectgetEntity()Disables access to the entity for aMultiPart.voidsetEntity(java.lang.Object entity)Disables access to the entity for aMultiPart.voidsetMediaType(javax.ws.rs.core.MediaType mediaType)Sets theMediaTypefor thisMultiPart.MultiParttype(javax.ws.rs.core.MediaType type)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
-
-
-
-
Field Detail
-
bodyParts
private BodyPartsList bodyParts
-
-
Constructor Detail
-
MultiPart
public MultiPart()
-
MultiPart
public MultiPart(javax.ws.rs.core.MediaType mediaType)
Instantiates a newMultiPartwith the specified characteristics.- Parameters:
mediaType- theMediaTypefor this multipart.
-
-
Method Detail
-
getBodyParts
public java.util.List<BodyPart> getBodyParts()
-
getEntity
public java.lang.Object getEntity()
-
setEntity
public void setEntity(java.lang.Object entity)
-
setMediaType
public void setMediaType(javax.ws.rs.core.MediaType mediaType)
- Overrides:
setMediaTypein classBodyPart- Parameters:
mediaType- the newMediaType.- Throws:
java.lang.IllegalArgumentException- if thetypeproperty is not set tomultipart.
-
bodyPart
public MultiPart bodyPart(java.lang.Object entity, javax.ws.rs.core.MediaType mediaType)
- Parameters:
entity- entity object for this body part.mediaType- content type for this body part.
-
entity
public BodyPart entity(java.lang.Object entity)
Override the entity set operation on aMultiPartto throwIllegalArgumentException.
-
type
public MultiPart type(javax.ws.rs.core.MediaType type)
Builder pattern method to return thisMultiPartafter additional configuration.
-
cleanup
public void cleanup()
Performs any necessary cleanup at the end of processing thisMultiPart.
-
close
public void close() throws java.io.IOException- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable- Throws:
java.io.IOException
-
-