The message class implementing the IMAP4 mail protocol.
getAllHeaderLines
public Enumeration getAllHeaderLines()
throws MessagingException
Get all header lines as an Enumeration of Strings.
A Header line is a raw RFC 822 header-line, containing both the "name"
and "value" field.
- getAllHeaderLines in interface MimePart
- getAllHeaderLines in interface MimeMessage
getAllHeaders
public Enumeration getAllHeaders()
throws MessagingException
Return all the headers from this Message as an enumeration of Header
objects.
Note that certain headers may be encoded as per RFC 2047 if they contain
non US-ASCII characters and these should be decoded.
This implementation obtains the headers from the
headers
InternetHeaders object.
- getAllHeaders in interface Part
- getAllHeaders in interface MimeMessage
- array of header objects
getContent
public Object getContent()
throws MessagingException,
IOException
Return the content as a Java object.
The type of this object is dependent on the content itself.
For example, the native format of a "text/plain" content is usually
a String object. The native format for a "multipart" message is always
a Multipart subclass. For content types that are unknown to the
DataHandler system, an input stream is returned as the content.
This implementation obtains the content from the DataHandler,
that is, it invokes
getDataHandler().getContent()
.
- getContent in interface Part
- getContent in interface MimeMessage
getContentStream
protected InputStream getContentStream()
throws MessagingException
Returns the raw content stream.
- getContentStream in interface MimeMessage
getFlags
public Flags getFlags()
throws MessagingException
Return a Flags object containing the flags for this message.
Note that a clone of the internal Flags object is returned, so modifying
the returned Flags object will not affect the flags of this message.
- getFlags in interface MimeMessage
- Flags object containing the flags for this message
getMatchingHeaderLines
public Enumeration getMatchingHeaderLines(String[] names)
throws MessagingException
Get matching header lines as an Enumeration of Strings.
A Header line is a raw RFC 822 header-line, containing both the "name"
and "value" field.
- getMatchingHeaderLines in interface MimePart
- getMatchingHeaderLines in interface MimeMessage
getMatchingHeaders
public Enumeration getMatchingHeaders(String[] names)
throws MessagingException
Return matching headers from this Message as an Enumeration of Header
objects.
This implementation obtains the headers from the
headers
InternetHeaders object.
- getMatchingHeaders in interface Part
- getMatchingHeaders in interface MimeMessage
getNonMatchingHeaderLines
public Enumeration getNonMatchingHeaderLines(String[] names)
throws MessagingException
Get non-matching header lines as an Enumeration of Strings.
A Header line is a raw RFC 822 header-line, containing both the "name"
and "value" field.
- getNonMatchingHeaderLines in interface MimePart
- getNonMatchingHeaderLines in interface MimeMessage
getNonMatchingHeaders
public Enumeration getNonMatchingHeaders(String[] names)
throws MessagingException
Return non-matching headers from this Message as an Enumeration of Header
objects.
This implementation obtains the headers from the
headers
InternetHeaders object.
- getNonMatchingHeaders in interface Part
- getNonMatchingHeaders in interface MimeMessage
getReceivedDate
public Date getReceivedDate()
throws MessagingException
Returns the date on which this message was received.
- getReceivedDate in interface MimeMessage
isSet
public boolean isSet(Flags.Flag flag)
throws MessagingException
Check whether the flag specified in the flag argument is set in this
message.
This implementation checks this message's internal flags object.
- isSet in interface MimeMessage
flag
- - the flag
- value of the specified flag for this message
setFlags
public void setFlags(Flags flag,
boolean set)
throws MessagingException
Set the specified flags.
- setFlags in interface gnu.mail.providers.ReadOnlyMessage
writeTo
public void writeTo(OutputStream msgStream)
throws IOException,
MessagingException
Output the message as an RFC 822 format stream.
Note that, depending on how the message was constructed, it may use a
variety of line termination conventions. Generally the output should be
sent through an appropriate FilterOutputStream that converts the line
terminators to the desired form, either CRLF for MIME compatibility and
for use in Internet protocols, or the local platform's line terminator
for storage in a local text file.
This implementation calls the
writeTo(OutputStream, String[])
method with a null ignore
list.
- writeTo in interface Part
- writeTo in interface MimeMessage
writeTo
public void writeTo(OutputStream msgStream,
String[] ignoreList)
throws IOException,
MessagingException
Output the message as an RFC 822 format stream, without specified
headers. If the saved flag is not set, the saveChanges
method is called. If the modified
flag is not set and
the content
array is not null, the content
array is written directly, after writing the appropriate message headers.
- writeTo in interface MimeMessage