|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.james.mime4j.message.Multipart
public class Multipart
Represents a MIME multipart body (see RFC 2045).A multipart body has a ordered list of body parts. The multipart body also has a preamble and epilogue. The preamble consists of whatever characters appear before the first body part while the epilogue consists of whatever characters come after the last body part.
| Constructor Summary | |
|---|---|
Multipart(Multipart other)
Creates a new Multipart from the specified
Multipart. |
|
Multipart(java.lang.String subType)
Creates a new empty Multipart instance. |
|
| Method Summary | |
|---|---|
void |
addBodyPart(BodyPart bodyPart)
Adds a body part to the end of the list of body parts. |
void |
addBodyPart(BodyPart bodyPart,
int index)
Inserts a body part at the specified position in the list of body parts. |
void |
dispose()
Disposes of the BodyParts of this Multipart. |
java.util.List<BodyPart> |
getBodyParts()
Gets the list of body parts. |
int |
getCount()
Returns the number of body parts. |
java.lang.String |
getEpilogue()
Gets the epilogue. |
Entity |
getParent()
Gets the parent of this body. |
java.lang.String |
getPreamble()
Gets the preamble. |
java.lang.String |
getSubType()
Gets the multipart sub-type. |
BodyPart |
removeBodyPart(int index)
Removes the body part at the specified position in the list of body parts. |
BodyPart |
replaceBodyPart(BodyPart bodyPart,
int index)
Replaces the body part at the specified position in the list of body parts with the specified body part. |
void |
setBodyParts(java.util.List<BodyPart> bodyParts)
Sets the list of body parts. |
void |
setEpilogue(java.lang.String epilogue)
Sets the epilogue. |
void |
setParent(Entity parent)
Sets the parent of this body. |
void |
setPreamble(java.lang.String preamble)
Sets the preamble. |
void |
setSubType(java.lang.String subType)
Sets the multipart sub-type. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Multipart(java.lang.String subType)
Multipart instance.
public Multipart(Multipart other)
Multipart from the specified
Multipart. The Multipart instance is
initialized with copies of preamble, epilogue, sub type and the list of
body parts of the specified Multipart. The parent entity
of the new multipart is null.
other - multipart to copy.
java.lang.UnsupportedOperationException - if other contains a SingleBody that
does not support the copy()
operation.
java.lang.IllegalArgumentException - if other contains a Body that
is neither a Message, Multipart or
SingleBody.| Method Detail |
|---|
public java.lang.String getSubType()
alternative (the
default) or parallel. See RFC 2045 for common sub-types
and their meaning.
public void setSubType(java.lang.String subType)
alternative or
parallel. See RFC 2045 for common sub-types and their
meaning.
subType - the sub-type.public Entity getParent()
Body
getParent in interface BodyBody.getParent()public void setParent(Entity parent)
Body
setParent in interface Bodyparent - the parent.Body.setParent(org.apache.james.mime4j.message.Entity)public int getCount()
BodyPart objects.public java.util.List<BodyPart> getBodyParts()
BodyPart objects.public void setBodyParts(java.util.List<BodyPart> bodyParts)
bodyParts - the new list of BodyPart objects.public void addBodyPart(BodyPart bodyPart)
bodyPart - the body part.
public void addBodyPart(BodyPart bodyPart,
int index)
bodyPart - the body part.index - index at which the specified body part is to be inserted.
java.lang.IndexOutOfBoundsException - if the index is out of range (index < 0 || index >
getCount()).public BodyPart removeBodyPart(int index)
index - index of the body part to be removed.
java.lang.IndexOutOfBoundsException - if the index is out of range (index < 0 || index >=
getCount()).
public BodyPart replaceBodyPart(BodyPart bodyPart,
int index)
bodyPart - body part to be stored at the specified position.index - index of body part to replace.
java.lang.IndexOutOfBoundsException - if the index is out of range (index < 0 || index >=
getCount()).public java.lang.String getPreamble()
public void setPreamble(java.lang.String preamble)
preamble - the preamble.public java.lang.String getEpilogue()
public void setEpilogue(java.lang.String epilogue)
epilogue - the epilogue.public void dispose()
dispose in interface DisposableDisposable.dispose()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||