com.sun.mail.pop3
类 POP3Message

java.lang.Object
  继承者 javax.mail.Message
      继承者 javax.mail.internet.MimeMessage
          继承者 com.sun.mail.pop3.POP3Message
所有已实现的接口:
MimePart, Part

public class POP3Message
extends MimeMessage

A POP3 Message. Just like a MimeMessage except that some things are not supported.

作者:
Bill Shannon

嵌套类摘要
 
从类 javax.mail.internet.MimeMessage 继承的嵌套类/接口
MimeMessage.RecipientType
 
字段摘要
 
从类 javax.mail.internet.MimeMessage 继承的字段
content, contentStream, dh, flags, headers, modified, saved
 
从类 javax.mail.Message 继承的字段
expunged, msgnum, session
 
从接口 javax.mail.Part 继承的字段
ATTACHMENT, 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 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.
 
从类 javax.mail.internet.MimeMessage 继承的方法
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, writeTo, writeTo
 
从类 javax.mail.Message 继承的方法
addRecipient, getFolder, getMessageNumber, isExpunged, match, setExpunged, setFlag, setMessageNumber, setRecipient
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

构造方法详细信息

POP3Message

public POP3Message(Folder folder,
                   int msgno)
            throws MessagingException
抛出:
MessagingException
方法详细信息

setFlags

public void setFlags(Flags newFlags,
                     boolean set)
              throws MessagingException
Set the specified flags on this message to the specified value.

覆盖:
MimeMessage 中的 setFlags
参数:
newFlags - the flags to be set
set - the value to be set
抛出:
MessagingException
IllegalWriteException - if the underlying implementation does not support modification of existing values.
另请参见:
MessageChangedEvent

getSize

public int getSize()
            throws MessagingException
Return the size of the content of this message in bytes. Returns -1 if the size cannot be determined.

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.

指定者:
接口 Part 中的 getSize
覆盖:
MimeMessage 中的 getSize
返回:
size of content in bytes
抛出:
MessagingException

getContentStream

protected InputStream getContentStream()
                                throws MessagingException
Produce the raw bytes of the content. The data is fetched using the POP3 RETR command.

覆盖:
MimeMessage 中的 getContentStream
抛出:
MessagingException
另请参见:
MimeMessage.contentStream

invalidate

public 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. If invalidateHeaders is true, invalidate the headers as well.

参数:
invalidateHeaders - invalidate the headers as well?

top

public InputStream top(int n)
                throws MessagingException
Fetch the header of the message and the first 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 fetch
返回:
InputStream containing the message headers and n content lines
抛出:
MessagingException

getHeader

public String[] getHeader(String name)
                   throws MessagingException
Get all the headers for this header_name. Note that certain headers may be encoded as per RFC 2047 if they contain non US-ASCII characters and these should be decoded.

指定者:
接口 Part 中的 getHeader
覆盖:
MimeMessage 中的 getHeader
参数:
name - name of header
返回:
array of headers
抛出:
MessagingException
另请参见:
MimeUtility

getHeader

public String getHeader(String name,
                        String delimiter)
                 throws MessagingException
Get all the headers for this header name, returned as a single String, with headers separated by the delimiter. If the delimiter is null, only the first header is returned.

指定者:
接口 MimePart 中的 getHeader
覆盖:
MimeMessage 中的 getHeader
参数:
name - the name of this header
delimiter - delimiter between returned headers
返回:
the value fields for all headers with this name
抛出:
MessagingException

setHeader

public void setHeader(String name,
                      String value)
               throws MessagingException
Set the value for this header_name. Throws IllegalWriteException because POP3 messages are read-only.

指定者:
接口 Part 中的 setHeader
覆盖:
MimeMessage 中的 setHeader
参数:
name - header name
value - header value
抛出:
IllegalWriteException - because the underlying implementation does not support modification
IllegalStateException - if this message is obtained from a READ_ONLY folder.
MessagingException
另请参见:
MimeUtility

addHeader

public void addHeader(String name,
                      String value)
               throws MessagingException
Add this value to the existing values for this header_name. Throws IllegalWriteException because POP3 messages are read-only.

指定者:
接口 Part 中的 addHeader
覆盖:
MimeMessage 中的 addHeader
参数:
name - header name
value - header value
抛出:
IllegalWriteException - because the underlying implementation does not support modification
IllegalStateException - if this message is obtained from a READ_ONLY folder.
MessagingException
另请参见:
MimeUtility

removeHeader

public void removeHeader(String name)
                  throws MessagingException
Remove all headers with this name. Throws IllegalWriteException because POP3 messages are read-only.

指定者:
接口 Part 中的 removeHeader
覆盖:
MimeMessage 中的 removeHeader
参数:
name - the name of this header
抛出:
IllegalWriteException - because the underlying implementation does not support modification
IllegalStateException - if this message is obtained from a READ_ONLY folder.
MessagingException

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.

指定者:
接口 Part 中的 getAllHeaders
覆盖:
MimeMessage 中的 getAllHeaders
返回:
array of header objects
抛出:
MessagingException
另请参见:
MimeUtility

getMatchingHeaders

public Enumeration getMatchingHeaders(String[] names)
                               throws MessagingException
Return matching headers from this Message as an Enumeration of Header objects.

指定者:
接口 Part 中的 getMatchingHeaders
覆盖:
MimeMessage 中的 getMatchingHeaders
返回:
enumeration of Header objects
抛出:
MessagingException

getNonMatchingHeaders

public Enumeration getNonMatchingHeaders(String[] names)
                                  throws MessagingException
Return non-matching headers from this Message as an Enumeration of Header objects.

指定者:
接口 Part 中的 getNonMatchingHeaders
覆盖:
MimeMessage 中的 getNonMatchingHeaders
返回:
enumeration of Header objects
抛出:
MessagingException

addHeaderLine

public void addHeaderLine(String line)
                   throws MessagingException
Add a raw RFC822 header-line. Throws IllegalWriteException because POP3 messages are read-only.

指定者:
接口 MimePart 中的 addHeaderLine
覆盖:
MimeMessage 中的 addHeaderLine
抛出:
IllegalWriteException - because the underlying implementation does not support modification
IllegalStateException - if this message is obtained from a READ_ONLY folder.
MessagingException

getAllHeaderLines

public Enumeration getAllHeaderLines()
                              throws MessagingException
Get all header lines as an Enumeration of Strings. A Header line is a raw RFC822 header-line, containing both the "name" and "value" field.

指定者:
接口 MimePart 中的 getAllHeaderLines
覆盖:
MimeMessage 中的 getAllHeaderLines
抛出:
MessagingException

getMatchingHeaderLines

public Enumeration getMatchingHeaderLines(String[] names)
                                   throws MessagingException
Get matching header lines as an Enumeration of Strings. A Header line is a raw RFC822 header-line, containing both the "name" and "value" field.

指定者:
接口 MimePart 中的 getMatchingHeaderLines
覆盖:
MimeMessage 中的 getMatchingHeaderLines
抛出:
MessagingException

getNonMatchingHeaderLines

public Enumeration getNonMatchingHeaderLines(String[] names)
                                      throws MessagingException
Get non-matching header lines as an Enumeration of Strings. A Header line is a raw RFC822 header-line, containing both the "name" and "value" field.

指定者:
接口 MimePart 中的 getNonMatchingHeaderLines
覆盖:
MimeMessage 中的 getNonMatchingHeaderLines
抛出:
MessagingException

saveChanges

public void saveChanges()
                 throws MessagingException
POP3 message can't be changed. This method throws IllegalWriteException.

覆盖:
MimeMessage 中的 saveChanges
抛出:
IllegalWriteException - because the underlying implementation does not support modification
MessagingException


Copyright © 2013. All Rights Reserved.