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 extendsBodyPart
because MultiPart entities can be nested inside other MultiPart entities to an arbitrary depth.
-
-
Field Summary
Fields Modifier and Type Field Description private BodyPartsList
bodyParts
-
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 MultiPart
bodyPart(java.lang.Object entity, javax.ws.rs.core.MediaType mediaType)
MultiPart
bodyPart(BodyPart bodyPart)
void
cleanup()
Performs any necessary cleanup at the end of processing thisMultiPart
.void
close()
BodyPart
entity(java.lang.Object entity)
Override the entity set operation on aMultiPart
to throwIllegalArgumentException
.java.util.List<BodyPart>
getBodyParts()
java.lang.Object
getEntity()
Disables access to the entity for aMultiPart
.void
setEntity(java.lang.Object entity)
Disables access to the entity for aMultiPart
.void
setMediaType(javax.ws.rs.core.MediaType mediaType)
Sets theMediaType
for thisMultiPart
.MultiPart
type(javax.ws.rs.core.MediaType type)
Builder pattern method to return thisMultiPart
after 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 newMultiPart
with the specified characteristics.- Parameters:
mediaType
- theMediaType
for 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:
setMediaType
in classBodyPart
- Parameters:
mediaType
- the newMediaType
.- Throws:
java.lang.IllegalArgumentException
- if thetype
property 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 aMultiPart
to throwIllegalArgumentException
.
-
type
public MultiPart type(javax.ws.rs.core.MediaType type)
Builder pattern method to return thisMultiPart
after 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:
close
in interfacejava.lang.AutoCloseable
- Specified by:
close
in interfacejava.io.Closeable
- Throws:
java.io.IOException
-
-