javax.mail
Class Multipart
public abstract class Multipart
extends java.lang.Object
protected String | contentType - The content type of this multipart object; defaults to "multipart/mixed"
|
protected Part | parent - The Part that contains this multipart.
|
protected Vector | parts - Vector of sub-parts.
|
void | addBodyPart(BodyPart part) - Add a part to the end of the list.
|
void | addBodyPart(BodyPart part, int pos) - Insert a part into the list at a designated point; all subsequent parts move down
|
BodyPart | getBodyPart(int index) - Get the specified part; numbering starts at zero.
|
String | getContentType() - Return the content type.
|
int | getCount() - Return the number of enclosed parts
|
Part | getParent() - Return the Part containing this Multipart object or null if unknown.
|
void | removeBodyPart(int index) - Remove the specified part; all others move down one
|
boolean | removeBodyPart(BodyPart part) - Remove the supplied part from the list.
|
protected void | setMultipartDataSource(MultipartDataSource mds) - Initialize this multipart object from the supplied data source.
|
void | setParent(Part part) - Set the parent of this Multipart object
|
abstract void | writeTo(OutputStream out) - Encode and write this multipart to the supplied OutputStream; the encoding
used is determined by the implementation.
|
contentType
protected String contentType
The content type of this multipart object; defaults to "multipart/mixed"
parent
protected Part parent
The Part that contains this multipart.
parts
protected Vector parts
Vector of sub-parts.
Multipart
protected Multipart()
addBodyPart
public void addBodyPart(BodyPart part,
int pos)
throws MessagingException
Insert a part into the list at a designated point; all subsequent parts move down
part
- the part to addpos
- the index of the new part
getContentType
public String getContentType()
Return the content type.
getCount
public int getCount()
throws MessagingException
Return the number of enclosed parts
getParent
public Part getParent()
Return the Part containing this Multipart object or null if unknown.
removeBodyPart
public void removeBodyPart(int index)
throws MessagingException
Remove the specified part; all others move down one
index
- the part to remove
removeBodyPart
public boolean removeBodyPart(BodyPart part)
throws MessagingException
Remove the supplied part from the list.
part
- the part to remove
- true if the part was removed
setMultipartDataSource
protected void setMultipartDataSource(MultipartDataSource mds)
throws MessagingException
Initialize this multipart object from the supplied data source.
This adds any
BodyParts
into this object and initializes the content type.
setParent
public void setParent(Part part)
Set the parent of this Multipart object
part
- this object's parent
writeTo
public abstract void writeTo(OutputStream out)
throws IOException,
MessagingException
Encode and write this multipart to the supplied OutputStream; the encoding
used is determined by the implementation.
out
- the stream to write to