public class POP3Message extends MimeMessage implements ReadableMime
MimeMessage.RecipientType| Modifier and Type | Field and Description |
|---|---|
private POP3Folder |
folder |
private int |
hdrSize |
private int |
msgSize |
private java.lang.ref.SoftReference |
rawData |
(package private) java.lang.String |
uid |
(package private) static java.lang.String |
UNKNOWN |
cachedContent, content, contentStream, dh, flags, headers, modified, savedATTACHMENT, INLINE| Constructor and Description |
|---|
POP3Message(Folder folder,
int msgno) |
| Modifier and Type | Method and Description |
|---|---|
void |
addHeader(java.lang.String name,
java.lang.String value)
Add this value to the existing values for this header_name.
|
void |
addHeaderLine(java.lang.String line)
Add a raw RFC822 header-line.
|
java.util.Enumeration |
getAllHeaderLines()
Get all header lines as an Enumeration of Strings.
|
java.util.Enumeration |
getAllHeaders()
Return all the headers from this Message as an enumeration
of Header objects.
|
protected java.io.InputStream |
getContentStream()
Produce the raw bytes of the content.
|
java.lang.String[] |
getHeader(java.lang.String name)
Get all the headers for this header_name.
|
java.lang.String |
getHeader(java.lang.String name,
java.lang.String delimiter)
Get all the headers for this header name, returned as a single
String, with headers separated by the delimiter.
|
java.util.Enumeration |
getMatchingHeaderLines(java.lang.String[] names)
Get matching header lines as an Enumeration of Strings.
|
java.util.Enumeration |
getMatchingHeaders(java.lang.String[] names)
Return matching headers from this Message as an Enumeration of
Header objects.
|
java.io.InputStream |
getMimeStream()
Return the MIME format stream corresponding to this message part.
|
java.util.Enumeration |
getNonMatchingHeaderLines(java.lang.String[] names)
Get non-matching header lines as an Enumeration of Strings.
|
java.util.Enumeration |
getNonMatchingHeaders(java.lang.String[] names)
Return non-matching headers from this Message as an
Enumeration of Header objects.
|
private java.io.InputStream |
getRawStream(boolean skipHeader)
Produce the raw bytes of the message.
|
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.
|
private void |
loadHeaders()
Load the headers for this message into the InternetHeaders object.
|
void |
removeHeader(java.lang.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(java.lang.String name,
java.lang.String value)
Set the value for this header_name.
|
java.io.InputStream |
top(int n)
Fetch the header of the message and the first
n lines
of the raw content of the message. |
void |
writeTo(java.io.OutputStream os,
java.lang.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, reply, setContent, setContent, setContentID, setContentLanguage, setContentMD5, setDataHandler, setDescription, setDescription, setDisposition, setFileName, setFrom, setFrom, setFrom, setRecipients, setRecipients, setReplyTo, setSender, setSentDate, setSubject, setSubject, setText, setText, setText, updateHeaders, updateMessageID, writeToaddRecipient, getFolder, getMessageNumber, getSession, isExpunged, match, setExpunged, setFlag, setMessageNumber, setRecipientstatic final java.lang.String UNKNOWN
private POP3Folder folder
private int hdrSize
private int msgSize
java.lang.String uid
private java.lang.ref.SoftReference rawData
public 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 setIllegalWriteException - if the underlying
implementation does not support modificationMessagingException - for other failuresMessageChangedEventpublic 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 MimeMessageMessagingException - for failuresprivate java.io.InputStream getRawStream(boolean skipHeader)
throws MessagingException
MessagingExceptionprotected java.io.InputStream getContentStream()
throws MessagingException
getContentStream in class MimeMessageMessagingException - for failuresMimeMessage.contentStreampublic java.io.InputStream getMimeStream()
throws MessagingException
getMimeStream in interface ReadableMimeMessagingException - for failurespublic void invalidate(boolean invalidateHeaders)
invalidateHeaders is true, invalidate the headers
as well.invalidateHeaders - invalidate the headers as well?public java.io.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 fetchMessagingException - for failurespublic java.lang.String[] getHeader(java.lang.String name)
throws MessagingException
getHeader in interface PartgetHeader in class MimeMessagename - name of headerMessagingException - for failuresMimeUtilitypublic java.lang.String getHeader(java.lang.String name,
java.lang.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 headersMessagingException - for failurespublic void setHeader(java.lang.String name,
java.lang.String value)
throws MessagingException
setHeader in interface PartsetHeader in class MimeMessagename - header namevalue - header valueIllegalWriteException - because the underlying
implementation does not support modificationjava.lang.IllegalStateException - if this message is
obtained from a READ_ONLY folder.MessagingException - for other failuresMimeUtilitypublic void addHeader(java.lang.String name,
java.lang.String value)
throws MessagingException
addHeader in interface PartaddHeader in class MimeMessagename - header namevalue - header valueIllegalWriteException - because the underlying
implementation does not support modificationjava.lang.IllegalStateException - if this message is
obtained from a READ_ONLY folder.MessagingException - for other failuresMimeUtilitypublic void removeHeader(java.lang.String name)
throws MessagingException
removeHeader in interface PartremoveHeader in class MimeMessagename - the name of this headerIllegalWriteException - because the underlying
implementation does not support modificationjava.lang.IllegalStateException - if this message is
obtained from a READ_ONLY folder.MessagingException - for other failurespublic java.util.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 MimeMessageMessagingException - for failuresMimeUtilitypublic java.util.Enumeration getMatchingHeaders(java.lang.String[] names)
throws MessagingException
getMatchingHeaders in interface PartgetMatchingHeaders in class MimeMessagenames - the headers to matchMessagingException - for failurespublic java.util.Enumeration getNonMatchingHeaders(java.lang.String[] names)
throws MessagingException
getNonMatchingHeaders in interface PartgetNonMatchingHeaders in class MimeMessagenames - the headers to not matchMessagingException - for failurespublic void addHeaderLine(java.lang.String line)
throws MessagingException
addHeaderLine in interface MimePartaddHeaderLine in class MimeMessageline - the line to addIllegalWriteException - because the underlying
implementation does not support modificationjava.lang.IllegalStateException - if this message is
obtained from a READ_ONLY folder.MessagingException - for other failurespublic java.util.Enumeration getAllHeaderLines()
throws MessagingException
getAllHeaderLines in interface MimePartgetAllHeaderLines in class MimeMessageMessagingException - for failurespublic java.util.Enumeration getMatchingHeaderLines(java.lang.String[] names)
throws MessagingException
getMatchingHeaderLines in interface MimePartgetMatchingHeaderLines in class MimeMessagenames - the headers to returnMessagingException - for failurespublic java.util.Enumeration getNonMatchingHeaderLines(java.lang.String[] names)
throws MessagingException
getNonMatchingHeaderLines in interface MimePartgetNonMatchingHeaderLines in class MimeMessagenames - the headers to not returnMessagingException - for failurespublic void saveChanges()
throws MessagingException
saveChanges in class MimeMessageIllegalWriteException - because the underlying
implementation does not support modificationMessagingException - for other failurespublic void writeTo(java.io.OutputStream os,
java.lang.String[] ignoreList)
throws java.io.IOException,
MessagingException
writeTo in class MimeMessageos - the stream to write toignoreList - the headers to not include in the outputjava.io.IOException - if an error occurs writing to the stream
or if an error is generated by the
javax.activation layer.MessagingException - for other failuresDataHandler.writeTo(java.io.OutputStream)private void loadHeaders()
throws MessagingException
MessagingException