public class POP3Message extends MimeMessage
MimeMessage.RecipientTypecontent, contentStream, dh, flags, headers, modified, savedATTACHMENT, INLINE| Constructor and Description |
|---|
POP3Message(Folder folder,
int msgno) |
| Modifier and Type | Method and Description |
|---|---|
void |
addHeader(String name,
String value)
Add this value to the existing values for this header_name.
|
void |
addHeaderLine(String line)
Add a raw RFC822 header-line.
|
Enumeration |
getAllHeaderLines()
Get all header lines as an Enumeration of Strings.
|
Enumeration |
getAllHeaders()
Return all the headers from this Message as an enumeration
of Header objects.
|
protected InputStream |
getContentStream()
Produce the raw bytes of the content.
|
String[] |
getHeader(String name)
Get all the headers for this header_name.
|
String |
getHeader(String name,
String delimiter)
Get all the headers for this header name, returned as a single
String, with headers separated by the delimiter.
|
Enumeration |
getMatchingHeaderLines(String[] names)
Get matching header lines as an Enumeration of Strings.
|
Enumeration |
getMatchingHeaders(String[] names)
Return matching headers from this Message as an Enumeration of
Header objects.
|
Enumeration |
getNonMatchingHeaderLines(String[] names)
Get non-matching header lines as an Enumeration of Strings.
|
Enumeration |
getNonMatchingHeaders(String[] names)
Return non-matching headers from this Message as an
Enumeration of Header objects.
|
int |
getSize()
Return the size of the content of this message in bytes.
|
void |
invalidate(boolean invalidateHeaders)
Invalidate the cache of content for this message object, causing
it to be fetched again from the server the next time it is needed.
|
void |
removeHeader(String name)
Remove all headers with this name.
|
void |
saveChanges()
POP3 message can't be changed.
|
void |
setFlags(Flags newFlags,
boolean set)
Set the specified flags on this message to the specified value.
|
void |
setHeader(String name,
String value)
Set the value for this header_name.
|
InputStream |
top(int n)
Fetch the header of the message and the first
n lines
of the raw content of the message. |
void |
writeTo(OutputStream os,
String[] ignoreList)
Output the message as an RFC 822 format stream, without
specified headers.
|
addFrom, addRecipients, addRecipients, createInternetHeaders, createMimeMessage, getAllRecipients, getContent, getContentID, getContentLanguage, getContentMD5, getContentType, getDataHandler, getDescription, getDisposition, getEncoding, getFileName, getFlags, getFrom, getInputStream, getLineCount, getMessageID, getRawInputStream, getReceivedDate, getRecipients, getReplyTo, getSender, getSentDate, getSubject, isMimeType, isSet, parse, reply, setContent, setContent, setContentID, setContentLanguage, setContentMD5, setDataHandler, setDescription, setDescription, setDisposition, setFileName, setFrom, setFrom, setRecipients, setRecipients, setReplyTo, setSender, setSentDate, setSubject, setSubject, setText, setText, setText, updateHeaders, updateMessageID, writeToaddRecipient, getFolder, getMessageNumber, isExpunged, match, setExpunged, setFlag, setMessageNumber, setRecipientpublic POP3Message(Folder folder, int msgno) throws MessagingException
MessagingExceptionpublic void setFlags(Flags newFlags, boolean set) throws MessagingException
setFlags in class MimeMessagenewFlags - the flags to be setset - the value to be setMessagingExceptionIllegalWriteException - if the underlying
implementation does not support modification
of existing values.MessageChangedEventpublic int getSize()
throws MessagingException
Note that this number may not be an exact measure of the content size and may or may not account for any transfer encoding of the content.
getSize in interface PartgetSize in class MimeMessageMessagingExceptionprotected InputStream getContentStream() throws MessagingException
getContentStream in class MimeMessageMessagingExceptionMimeMessage.contentStreampublic void invalidate(boolean invalidateHeaders)
invalidateHeaders is true, invalidate the headers
as well.invalidateHeaders - invalidate the headers as well?public InputStream top(int n) throws MessagingException
n lines
of the raw content of the message. The headers and data are
available in the returned InputStream.n - number of lines of content to fetchMessagingExceptionpublic String[] getHeader(String name) throws MessagingException
getHeader in interface PartgetHeader in class MimeMessagename - name of headerMessagingExceptionMimeUtilitypublic String getHeader(String name, String delimiter) throws MessagingException
null, only the first header is
returned.getHeader in interface MimePartgetHeader in class MimeMessagename - the name of this headerdelimiter - delimiter between returned headersMessagingExceptionpublic void setHeader(String name, String value) throws MessagingException
setHeader in interface PartsetHeader in class MimeMessagename - header namevalue - header valueIllegalWriteException - because the underlying
implementation does not support modificationIllegalStateException - if this message is
obtained from a READ_ONLY folder.MessagingExceptionMimeUtilitypublic void addHeader(String name, String value) throws MessagingException
addHeader in interface PartaddHeader in class MimeMessagename - header namevalue - header valueIllegalWriteException - because the underlying
implementation does not support modificationIllegalStateException - if this message is
obtained from a READ_ONLY folder.MessagingExceptionMimeUtilitypublic void removeHeader(String name) throws MessagingException
removeHeader in interface PartremoveHeader in class MimeMessagename - the name of this headerIllegalWriteException - because the underlying
implementation does not support modificationIllegalStateException - if this message is
obtained from a READ_ONLY folder.MessagingExceptionpublic Enumeration getAllHeaders() throws MessagingException
Note that certain headers may be encoded as per RFC 2047 if they contain non US-ASCII characters and these should be decoded.
getAllHeaders in interface PartgetAllHeaders in class MimeMessageMessagingExceptionMimeUtilitypublic Enumeration getMatchingHeaders(String[] names) throws MessagingException
getMatchingHeaders in interface PartgetMatchingHeaders in class MimeMessageMessagingExceptionpublic Enumeration getNonMatchingHeaders(String[] names) throws MessagingException
getNonMatchingHeaders in interface PartgetNonMatchingHeaders in class MimeMessageMessagingExceptionpublic void addHeaderLine(String line) throws MessagingException
addHeaderLine in interface MimePartaddHeaderLine in class MimeMessageIllegalWriteException - because the underlying
implementation does not support modificationIllegalStateException - if this message is
obtained from a READ_ONLY folder.MessagingExceptionpublic Enumeration getAllHeaderLines() throws MessagingException
getAllHeaderLines in interface MimePartgetAllHeaderLines in class MimeMessageMessagingExceptionpublic Enumeration getMatchingHeaderLines(String[] names) throws MessagingException
getMatchingHeaderLines in interface MimePartgetMatchingHeaderLines in class MimeMessageMessagingExceptionpublic Enumeration getNonMatchingHeaderLines(String[] names) throws MessagingException
getNonMatchingHeaderLines in interface MimePartgetNonMatchingHeaderLines in class MimeMessageMessagingExceptionpublic void saveChanges()
throws MessagingException
saveChanges in class MimeMessageIllegalWriteException - because the underlying
implementation does not support modificationMessagingExceptionpublic void writeTo(OutputStream os, String[] ignoreList) throws IOException, MessagingException
writeTo in class MimeMessageMessagingExceptionIOException - if an error occurs writing to the stream
or if an error is generated by the
javax.activation layer.DataHandler.writeTo(java.io.OutputStream)Copyright © 2012 JBoss by Red Hat. All Rights Reserved.