public class MultiPart extends BodyPart implements java.io.Closeable
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.
| Constructor and Description |
|---|
MultiPart()
|
MultiPart(MediaType mediaType)
Instantiate a new
MultiPart with the specified characteristics. |
| Modifier and Type | Method and Description |
|---|---|
MultiPart |
bodyPart(BodyPart bodyPart)
|
MultiPart |
bodyPart(java.lang.Object entity,
MediaType mediaType)
|
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()
|
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)
|
MultiPart |
type(MediaType type)
Builder pattern method to return this
MultiPart after
additional configuration. |
contentDisposition, getContentDisposition, getEntityAs, getHeaders, getMediaType, getParameterizedHeaders, getParent, getProviders, setContentDisposition, setParent, setProviderspublic MultiPart()
Instantiate a new MultiPart with a mediaType of
multipart/mixed.
public java.util.List<BodyPart> getBodyParts()
public java.lang.Object getEntity()
public void setEntity(java.lang.Object entity)
public void setMediaType(MediaType mediaType)
setMediaType in class BodyPartmediaType - The new MediaTypejava.lang.IllegalArgumentException - if the type property
is not set to multipartpublic MultiPart bodyPart(java.lang.Object entity, MediaType mediaType)
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.
public MultiPart type(MediaType type)
Builder pattern method to return this MultiPart after
additional configuration.
public void cleanup()
Perform any necessary cleanup at the end of processing this
MultiPart.
public void close()
throws java.io.IOException
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablejava.io.IOExceptionCopyright © 2016 Oracle Corporation. All Rights Reserved.