public class POP3Message extends MimeMessage implements ReadableMime
MimeMessage.RecipientTypecachedContent, content, contentStream, dh, flags, headers, modified, savedATTACHMENT, INLINE| 构造器和说明 |
|---|
POP3Message(Folder folder,
int msgno) |
| 限定符和类型 | 方法和说明 |
|---|---|
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<String> |
getAllHeaderLines()
Get all header lines as an Enumeration of Strings.
|
Enumeration<Header> |
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<String> |
getMatchingHeaderLines(String[] names)
Get matching header lines as an Enumeration of Strings.
|
Enumeration<Header> |
getMatchingHeaders(String[] names)
Return matching headers from this Message as an Enumeration of Header
objects.
|
InputStream |
getMimeStream()
Return the MIME format stream corresponding to this message part.
|
Enumeration<String> |
getNonMatchingHeaderLines(String[] names)
Get non-matching header lines as an Enumeration of Strings.
|
Enumeration<Header> |
getNonMatchingHeaders(String[] names)
Return non-matching headers from this Message as an Enumeration of Header
objects.
|
Date |
getReceivedDate()
Returns the Date on this message was received.
|
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, 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, setRecipientpublic POP3Message(Folder folder, int msgno) throws MessagingException
public void setFlags(Flags newFlags, boolean set) throws MessagingException
setFlags 在类中 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 在接口中 PartgetSize 在类中 MimeMessageMessagingException - for failuresprotected InputStream getContentStream() throws MessagingException
getContentStream 在类中 MimeMessageMessagingException - for failuresMimeMessage.contentStreampublic InputStream getMimeStream() throws MessagingException
getMimeStream 在接口中 ReadableMimeMessagingException - for failurespublic 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 fetchMessagingException - for failurespublic String[] getHeader(String name) throws MessagingException
getHeader 在接口中 PartgetHeader 在类中 MimeMessagename - name of headerMessagingException - for failuresMimeUtilitypublic Date getReceivedDate() throws MessagingException
MimeMessagenull if this date cannot be obtained. Note that RFC 822 does not define a field for the received date. Hence only implementations that can provide this date need return a valid value.
This implementation returns null.
getReceivedDate 在类中 MimeMessageMessagingException - for failurespublic String getHeader(String name, String delimiter) throws MessagingException
null,
only the first header is returned.getHeader 在接口中 MimePartgetHeader 在类中 MimeMessagename - the name of this headerdelimiter - delimiter between returned headersMessagingException - for failurespublic void setHeader(String name, String value) throws MessagingException
setHeader 在接口中 PartsetHeader 在类中 MimeMessagename - header namevalue - header valueIllegalWriteException - because the underlying implementation does
not support modificationIllegalStateException - if this message is obtained from a READ_ONLY
folder.MessagingException - for other failuresMimeUtilitypublic void addHeader(String name, String value) throws MessagingException
addHeader 在接口中 PartaddHeader 在类中 MimeMessagename - header namevalue - header valueIllegalWriteException - because the underlying implementation does
not support modificationIllegalStateException - if this message is obtained from a READ_ONLY
folder.MessagingException - for other failuresMimeUtilitypublic void removeHeader(String name) throws MessagingException
removeHeader 在接口中 PartremoveHeader 在类中 MimeMessagename - the name of this headerIllegalWriteException - because the underlying implementation does
not support modificationIllegalStateException - if this message is obtained from a READ_ONLY
folder.MessagingException - for other failurespublic Enumeration<Header> 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 在接口中 PartgetAllHeaders 在类中 MimeMessageMessagingException - for failuresMimeUtilitypublic Enumeration<Header> getMatchingHeaders(String[] names) throws MessagingException
getMatchingHeaders 在接口中 PartgetMatchingHeaders 在类中 MimeMessagenames - the headers to matchMessagingException - for failurespublic Enumeration<Header> getNonMatchingHeaders(String[] names) throws MessagingException
getNonMatchingHeaders 在接口中 PartgetNonMatchingHeaders 在类中 MimeMessagenames - the headers to not matchMessagingException - for failurespublic void addHeaderLine(String line) throws MessagingException
addHeaderLine 在接口中 MimePartaddHeaderLine 在类中 MimeMessageline - the line to addIllegalWriteException - because the underlying implementation does
not support modificationIllegalStateException - if this message is obtained from a READ_ONLY
folder.MessagingException - for other failurespublic Enumeration<String> getAllHeaderLines() throws MessagingException
getAllHeaderLines 在接口中 MimePartgetAllHeaderLines 在类中 MimeMessageMessagingException - for failurespublic Enumeration<String> getMatchingHeaderLines(String[] names) throws MessagingException
getMatchingHeaderLines 在接口中 MimePartgetMatchingHeaderLines 在类中 MimeMessagenames - the headers to returnMessagingException - for failurespublic Enumeration<String> getNonMatchingHeaderLines(String[] names) throws MessagingException
getNonMatchingHeaderLines 在接口中 MimePartgetNonMatchingHeaderLines 在类中 MimeMessagenames - the headers to not returnMessagingException - for failurespublic void saveChanges()
throws MessagingException
saveChanges 在类中 MimeMessageIllegalWriteException - because the underlying implementation does
not support modificationMessagingException - for other failurespublic void writeTo(OutputStream os, String[] ignoreList) throws IOException, MessagingException
writeTo 在类中 MimeMessageos - the stream to write toignoreList - the headers to not include in the outputIOException - 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)Copyright © 2021 Oracle. All rights reserved.