public class MultipartReport extends MimeMultipart
A MultipartReport object is a special type of MimeMultipart object with a restricted set of body parts. A MultipartReport object contains:
Report
object containing the
details for why the report was generated.Modifier and Type | Field | Description |
---|---|---|
protected boolean |
constructed |
allowEmpty, complete, ds, ignoreExistingBoundaryParameter, ignoreMissingBoundaryParameter, ignoreMissingEndBoundary, parsed, preamble
contentType, parent, parts
Constructor | Description |
---|---|
MultipartReport() |
Construct a multipart/report object with no content.
|
MultipartReport(java.lang.String text,
Report report) |
Construct a multipart/report object with the specified plain
text and report type (DeliveryStatus or DispositionNotification)
to be returned to the user.
|
MultipartReport(java.lang.String text,
Report report,
InternetHeaders hdr) |
Construct a multipart/report object with the specified plain
text, report, and headers from the original message
to be returned to the user.
|
MultipartReport(java.lang.String text,
Report report,
MimeMessage msg) |
Construct a multipart/report object with the specified plain
text, report, and original message to be returned to the user.
|
MultipartReport(javax.activation.DataSource ds) |
Constructs a MultipartReport object and its bodyparts from the
given DataSource.
|
Modifier and Type | Method | Description |
---|---|---|
void |
addBodyPart(BodyPart part) |
Adds a Part to the multipart.
|
void |
addBodyPart(BodyPart part,
int index) |
Adds a BodyPart at position
index . |
DeliveryStatus |
getDeliveryStatus() |
Deprecated.
use getReport instead
|
Report |
getReport() |
Get the report associated with this multipart/report.
|
MimeMessage |
getReturnedMessage() |
Get the original message that is being returned along with this
multipart/report.
|
java.lang.String |
getText() |
Get the plain text to be presented to the user, if there is any.
|
MimeBodyPart |
getTextBodyPart() |
Return the body part containing the message to be presented to
the user, usually just a text/plain part.
|
void |
removeBodyPart(int index) |
Remove the part at specified location (starting from 0).
|
boolean |
removeBodyPart(BodyPart part) |
Remove the specified part from the multipart message.
|
void |
setDeliveryStatus(DeliveryStatus status) |
Set the delivery status associated with this multipart/report.
|
void |
setReport(Report report) |
Set the report associated with this multipart/report.
|
void |
setReturnedMessage(MimeMessage msg) |
Set the original message to be returned as part of the
multipart/report.
|
void |
setSubType(java.lang.String subtype) |
Set the subtype.
|
void |
setText(java.lang.String text) |
Set the message to be presented to the user as just a text/plain
part containing the specified text.
|
void |
setTextBodyPart(MimeBodyPart mbp) |
Set the body part containing the text to be presented to the
user.
|
createInternetHeaders, createMimeBodyPart, createMimeBodyPart, getBodyPart, getBodyPart, getCount, getPreamble, initializeProperties, isComplete, parse, setPreamble, updateHeaders, writeTo
getContentType, getParent, setMultipartDataSource, setParent
public MultipartReport() throws MessagingException
MessagingException
- for failurespublic MultipartReport(java.lang.String text, Report report) throws MessagingException
text
- the plain textreport
- the Report objectMessagingException
- for failurespublic MultipartReport(java.lang.String text, Report report, MimeMessage msg) throws MessagingException
text
- the plain textreport
- the Report objectmsg
- the message this report is aboutMessagingException
- for failurespublic MultipartReport(java.lang.String text, Report report, InternetHeaders hdr) throws MessagingException
text
- the plain textreport
- the Report objecthdr
- the headers of the message this report is aboutMessagingException
- for failurespublic MultipartReport(javax.activation.DataSource ds) throws MessagingException
ds
- DataSource, can be a MultipartDataSourceMessagingException
- for failurespublic java.lang.String getText() throws MessagingException
getTextBodyPart
method may be used to extract the data.MessagingException
- for failurespublic void setText(java.lang.String text) throws MessagingException
text
- the textMessagingException
- for failurespublic MimeBodyPart getTextBodyPart() throws MessagingException
MessagingException
- for failurespublic void setTextBodyPart(MimeBodyPart mbp) throws MessagingException
mbp
- the body part containing the textMessagingException
- for failurespublic Report getReport() throws MessagingException
MessagingException
- for failurespublic void setReport(Report report) throws MessagingException
report
- the Report objectMessagingException
- for failures@Deprecated public DeliveryStatus getDeliveryStatus() throws MessagingException
MessagingException
- for failurespublic void setDeliveryStatus(DeliveryStatus status) throws MessagingException
status
- the deliver statusMessagingException
- for failurespublic MimeMessage getReturnedMessage() throws MessagingException
MessagingException
- for failurespublic void setReturnedMessage(MimeMessage msg) throws MessagingException
msg
- the returned messageMessagingException
- for failurespublic void setSubType(java.lang.String subtype) throws MessagingException
setSubType
in class MimeMultipart
subtype
- SubtypeMessagingException
- always; can't change subtypepublic boolean removeBodyPart(BodyPart part) throws MessagingException
removeBodyPart
in class MimeMultipart
part
- The part to removeMessagingException
- alwayspublic void removeBodyPart(int index) throws MessagingException
removeBodyPart
in class MimeMultipart
index
- Index of the part to removeMessagingException
- alwayspublic void addBodyPart(BodyPart part) throws MessagingException
addBodyPart
in class MimeMultipart
part
- The Part to be appendedMessagingException
- alwayspublic void addBodyPart(BodyPart part, int index) throws MessagingException
index
.
Not allowed on a multipart/report object.addBodyPart
in class MimeMultipart
part
- The BodyPart to be insertedindex
- Location where to insert the partMessagingException
- alwaysCopyright © 2018 Oracle. All rights reserved.