public abstract class CompoundBody extends Body
Body
s. MIME Multipart messages are CompoundBody
s,
as are Dime messages.Multipart
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
rootPartId |
CAN_INVALIDATE, contentType, CT_APP_OCTET_STREAM, CT_DEFAULT, CT_MULTIPART_RELATED, CT_TEXT_PLAIN, CT_TEXT_XML_UTF8, CT_XOP_APPLICATION_XML, PUSH_WRITE, REMOVE_XFER_ENCODING_ON_WRITE_DEPRECATED, RETAIN_XFER_ENCODING_ON_READ, WRITE_NO_CTE
Constructor and Description |
---|
CompoundBody(HeaderSet headers,
ContentType ct) |
Modifier and Type | Method and Description |
---|---|
void |
addPart(Body part) |
void |
addPart(java.lang.String id,
Body part)
Add a body part to this compound body, identified by "Id"
|
void |
clear()
Remove all parts of this compound body.
|
Body |
getPart(java.lang.String id)
Get a constituent body part by its ID
|
java.lang.Iterable<Body> |
getParts()
Get an iterator over all parts in this CompoundBody.
|
java.util.Set<java.util.Map.Entry<java.lang.String,Body>> |
getPartsById()
Return an Iterator over Set of Map.Entry objects,
keyed by Content ID, with values of Body objects
for each ID.
|
java.util.Map<java.lang.String,Body> |
getPartsByIdMap()
Return an Iterator over Set of Map.Entry objects,
keyed by Content ID, with values of Body objects
for each ID.
|
int |
getPartsCount()
Get the "start" For this message
|
Body |
getStartPart()
Get the "start" For this message
|
void |
purgeContent()
Purge a compound body.
|
boolean |
removePart(Body body)
Remove a body part
|
boolean |
removePart(java.lang.String id)
Remove a body part based on its Content-ID
|
void |
replacePart(Body oldB,
Body newB) |
void |
setStartPartID(java.lang.String startPartID)
Set the ID of the part considered the "starting point"
|
void |
sevenbit() |
bufferInput, contentAvailable, create, dispose, fini, getContentEncoding, getContentId, getContentLength, getContentType, getHeaders, getInputStream, getParent, getSource, initSource, parse, parse, registerFactory, setParent, write, writeContent
public CompoundBody(HeaderSet headers, ContentType ct)
public void setStartPartID(java.lang.String startPartID)
startPartID
- a string ID for the constituent bodypart.public Body getPart(java.lang.String id) throws java.io.IOException
java.io.IOException
public boolean removePart(java.lang.String id) throws java.io.IOException
id
- The content-id of the body part to remove.java.io.IOException
public boolean removePart(Body body) throws java.io.IOException
body
- The body part to remove.java.io.IOException
public Body getStartPart() throws java.io.IOException
java.io.IOException
public int getPartsCount() throws java.io.IOException
java.io.IOException
public java.lang.Iterable<Body> getParts() throws java.io.IOException
java.io.IOException
public java.util.Set<java.util.Map.Entry<java.lang.String,Body>> getPartsById() throws java.io.IOException
Any parts that do not have a Content-Id will be assigned one
java.io.IOException
public java.util.Map<java.lang.String,Body> getPartsByIdMap() throws java.io.IOException
Any parts that do not have a Content-Id will be assigned one
java.io.IOException
public void addPart(Body part)
public void addPart(java.lang.String id, Body part) throws java.io.IOException
id
- the ID of the new bodypartpart
- the new bodypartjava.io.IOException
public void purgeContent()
This method implements the interface from Body
by iterating over
all its constituent bodyparts, and purging those in turn.
purgeContent
in class Body
public void sevenbit() throws java.io.IOException
public void clear()
This documentation and all its contents and graphics, copyright © 1999 - 2011 Vordel