This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


com.sun.mail.dsn
class MultipartReport

javax.mail.Multipart extended by javax.mail.internet.MimeMultipart extended by com.sun.mail.dsn.MultipartReport

public class MultipartReport
extends MimeMultipart

A multipart/report message content, as defined in RFC 3462. A multipart/report content is a container for mail reports of any kind, and is most often used to return a delivery status report. This class only supports that most common usage.

A MultipartReport object is a special type of MimeMultipart object with a restricted set of body parts. A MultipartReport object contains:

Many of the normal MimeMultipart operations are restricted to ensure that the MultipartReport object always follows this structure.


Field Summary
protected boolean constructed
          
 
Fields inherited from class javax.mail.internet.MimeMultipart
ds, parsed
 
Fields inherited from class javax.mail.Multipart
contentType, parent, parts
 
Constructor Summary

          Construct a multipart/report object with no content.

          Constructs a MultipartReport object and its bodyparts from the given DataSource.

          Construct a multipart/report object with the specified plain text and delivery status to be returned to the user.

          Construct a multipart/report object with the specified plain text, delivery status, and headers from the original message to be returned to the user.

          Construct a multipart/report object with the specified plain text, delivery status, and original message to be returned to the user.
 
Method Summary
 void

          Adds a Part to the multipart.
 void
addBodyPart(BodyPart part, int index)

          Adds a BodyPart at position index.
 DeliveryStatus

          Get the delivery status associated with this multipart/report.
 MimeMessage

          Get the original message that is being returned along with this multipart/report.
 String

          Get the plain text to be presented to the user, if there is any.
 MimeBodyPart

          Return the body part containing the message to be presented to the user, usually just a text/plain part.
 boolean

          Remove the specified part from the multipart message.
 void
removeBodyPart(int index)

          Remove the part at specified location (starting from 0).
 void

          Set the delivery status associated with this multipart/report.
 void

          Set the original message to be returned as part of the multipart/report.
 void
setSubType(String subtype)

          Set the subtype.
 void

          Set the message to be presented to the user as just a text/plain part containing the specified text.
 void

          Set the body part containing the text to be presented to the user.
 
Methods inherited from class javax.mail.internet.MimeMultipart
addBodyPart, addBodyPart, createInternetHeaders, createMimeBodyPart, createMimeBodyPart, getBodyPart, getBodyPart, getCount, getPreamble, isComplete, parse, removeBodyPart, removeBodyPart, setPreamble, setSubType, updateHeaders, writeTo
 
Methods inherited from class javax.mail.Multipart
addBodyPart, addBodyPart, getBodyPart, getContentType, getCount, getParent, removeBodyPart, removeBodyPart, setMultipartDataSource, setParent, writeTo
 

Field Detail

constructed

protected boolean constructed
Constructor Detail

MultipartReport

public MultipartReport()
                throws MessagingException
Construct a multipart/report object with no content.

Throws:
MessagingException

MultipartReport

public MultipartReport(DataSource ds)
                throws MessagingException
Constructs a MultipartReport object and its bodyparts from the given DataSource.

Parameters:
ds - DataSource, can be a MultipartDataSource
Throws:
MessagingException

MultipartReport

public MultipartReport(String text,
                       DeliveryStatus status)
                throws MessagingException
Construct a multipart/report object with the specified plain text and delivery status to be returned to the user.

Parameters:
text
status
Throws:
MessagingException

MultipartReport

public MultipartReport(String text,
                       DeliveryStatus status,
                       InternetHeaders hdr)
                throws MessagingException
Construct a multipart/report object with the specified plain text, delivery status, and headers from the original message to be returned to the user.

Parameters:
text
status
hdr
Throws:
MessagingException

MultipartReport

public MultipartReport(String text,
                       DeliveryStatus status,
                       MimeMessage msg)
                throws MessagingException
Construct a multipart/report object with the specified plain text, delivery status, and original message to be returned to the user.

Parameters:
text
status
msg
Throws:
MessagingException
Method Detail

addBodyPart

public synchronized void addBodyPart(BodyPart part)
                              throws MessagingException
Adds a Part to the multipart. Not allowed on a multipart/report object.

Overrides:
addBodyPart in class MimeMultipart
Parameters:
part - The Part to be appended
Throws:
MessagingException - always

addBodyPart

public synchronized void addBodyPart(BodyPart part,
                                     int index)
                              throws MessagingException
Adds a BodyPart at position index. Not allowed on a multipart/report object.

Overrides:
addBodyPart in class MimeMultipart
Parameters:
part - The BodyPart to be inserted
index - Location where to insert the part
Throws:
MessagingException - always

getDeliveryStatus

public synchronized DeliveryStatus getDeliveryStatus()
                                              throws MessagingException
Get the delivery status associated with this multipart/report.

Throws:
MessagingException

getReturnedMessage

public synchronized MimeMessage getReturnedMessage()
                                            throws MessagingException
Get the original message that is being returned along with this multipart/report. If no original message is included, null is returned. In some cases only the headers of the original message will be returned as an object of type MessageHeaders.

Throws:
MessagingException

getText

public synchronized String getText()
                            throws MessagingException
Get the plain text to be presented to the user, if there is any. Rarely, the message may contain only HTML text, or no text at all. If the text body part of this multipart/report object is of type text/plain, or if it is of type multipart/alternative and contains a text/plain part, the text from that part is returned. Otherwise, null is return and the {@link #getTextBodyPart getTextBodyPart} method may be used to extract the data.

Throws:
MessagingException

getTextBodyPart

public synchronized MimeBodyPart getTextBodyPart()
                                          throws MessagingException
Return the body part containing the message to be presented to the user, usually just a text/plain part.

Throws:
MessagingException

removeBodyPart

public boolean removeBodyPart(BodyPart part)
                       throws MessagingException
Remove the specified part from the multipart message. Not allowed on a multipart/report object.

Overrides:
removeBodyPart in class MimeMultipart
Parameters:
part - The part to remove
Throws:
MessagingException - always

removeBodyPart

public void removeBodyPart(int index)
                    throws MessagingException
Remove the part at specified location (starting from 0). Not allowed on a multipart/report object.

Overrides:
removeBodyPart in class MimeMultipart
Parameters:
index - Index of the part to remove
Throws:
MessagingException - always

setDeliveryStatus

public synchronized void setDeliveryStatus(DeliveryStatus status)
                                    throws MessagingException
Set the delivery status associated with this multipart/report.

Parameters:
status
Throws:
MessagingException

setReturnedMessage

public synchronized void setReturnedMessage(MimeMessage msg)
                                     throws MessagingException
Set the original message to be returned as part of the multipart/report. If msg is null, any previously set returned message or headers is removed.

Parameters:
msg
Throws:
MessagingException

setSubType

public synchronized void setSubType(String subtype)
                             throws MessagingException
Set the subtype. Throws MessagingException.

Overrides:
setSubType in class MimeMultipart
Parameters:
subtype - Subtype
Throws:
MessagingException - always; can't change subtype

setText

public synchronized void setText(String text)
                          throws MessagingException
Set the message to be presented to the user as just a text/plain part containing the specified text.

Parameters:
text
Throws:
MessagingException

setTextBodyPart

public synchronized void setTextBodyPart(MimeBodyPart mbp)
                                  throws MessagingException
Set the body part containing the text to be presented to the user. Usually this a text/plain part, but it might also be a text/html part or a multipart/alternative part containing text/plain and text/html parts. Any type is allowed here but these types are most common.

Parameters:
mbp
Throws:
MessagingException


This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention. The official Sun™ documentation can be found here at http://java.sun.com/products/javamail/javadocs/index.html.