com.sun.mail.imap
类 IMAPMessage

java.lang.Object
  继承者 javax.mail.Message
      继承者 javax.mail.internet.MimeMessage
          继承者 com.sun.mail.imap.IMAPMessage
所有已实现的接口:
MimePart, Part
直接已知子类:
IMAPNestedMessage

public class IMAPMessage
extends MimeMessage

This class implements an IMAPMessage object.

An IMAPMessage object starts out as a light-weight object. It gets filled-in incrementally when a request is made for some item. Or when a prefetch is done using the FetchProfile.

An IMAPMessage has a messageNumber and a sequenceNumber. The messageNumber is its index into its containing folder's messageCache. The sequenceNumber is its IMAP sequence-number.

版本:
1.47, 07/05/04
作者:
John Mani, Bill Shannon

嵌套类摘要
 
从类 javax.mail.internet.MimeMessage 继承的嵌套类/接口
MimeMessage.RecipientType
 
字段摘要
protected  BODYSTRUCTURE bs
           
protected  ENVELOPE envelope
           
protected  String sectionId
           
 
从类 javax.mail.internet.MimeMessage 继承的字段
content, contentStream, dh, flags, headers, modified, saved
 
从类 javax.mail.Message 继承的字段
expunged, folder, msgnum, session
 
从接口 javax.mail.Part 继承的字段
ATTACHMENT, INLINE
 
构造方法摘要
protected IMAPMessage(IMAPFolder folder, int msgnum, int seqnum)
          Constructor.
protected IMAPMessage(Session session)
          Constructor, for use by IMAPNestedMessage.
 
方法摘要
 void addFrom(Address[] addresses)
          Add the specified addresses to the existing "From" field.
 void addHeader(String name, String value)
          Add this value to the existing values for this header_name.
 void addHeaderLine(String line)
          Add a raw RFC 822 header-line.
 void addRecipients(Message.RecipientType type, Address[] addresses)
          Add the given addresses to the specified recipient type.
protected  void checkExpunged()
           
protected  void forceCheckExpunged()
          Do a NOOP to force any untagged EXPUNGE responses and then check if this message is expunged.
 Enumeration getAllHeaderLines()
          Get all header-lines.
 Enumeration getAllHeaders()
          Get all headers.
 String getContentID()
          Get the Content-ID.
 String[] getContentLanguage()
          Get the content language.
 String getContentMD5()
          Get the Content-MD5.
protected  InputStream getContentStream()
          Get all the bytes for this message.
 String getContentType()
          Get the Content-Type.
 DataHandler getDataHandler()
          Get the DataHandler object for this message.
 String getDescription()
          Get the decoded Content-Description.
 String getDisposition()
          Get the Content-Disposition.
 String getEncoding()
          Get the Content-Transfer-Encoding.
protected  int getFetchBlockSize()
           
 String getFileName()
          Get the "filename" Disposition parameter.
 Flags getFlags()
          Get the Flags for this message.
 Address[] getFrom()
          Get the "From" attribute.
 String[] getHeader(String name)
          Get the named header.
 String getHeader(String name, String delimiter)
          Get the named header.
 String getInReplyTo()
          Get the In-Reply-To header.
 int getLineCount()
          Get the total number of lines.
 Enumeration getMatchingHeaderLines(String[] names)
          Get all matching header-lines.
 Enumeration getMatchingHeaders(String[] names)
          Get matching headers.
protected  Object getMessageCacheLock()
          Get the messageCacheLock, associated with this Message's Folder.
 String getMessageID()
          Get the Message-ID.
 Enumeration getNonMatchingHeaderLines(String[] names)
          Get all non-matching headerlines.
 Enumeration getNonMatchingHeaders(String[] names)
          Get non-matching headers.
 boolean getPeek()
          Get whether or not to use the PEEK variant of FETCH when fetching message content.
protected  IMAPProtocol getProtocol()
          Get this message's folder's protocol connection.
 Date getReceivedDate()
          Get the recieved date (INTERNALDATE)
 Address[] getRecipients(Message.RecipientType type)
          Get the desired Recipient type.
 Address[] getReplyTo()
          Get the ReplyTo addresses.
 Address getSender()
          Get the "Sender" attribute.
 Date getSentDate()
          Get the SentDate.
protected  int getSequenceNumber()
          Get this message's IMAP sequence number.
 int getSize()
          Get the message size.
 String getSubject()
          Get the decoded subject.
protected  long getUID()
           
 void invalidateHeaders()
          Invalidate cached header and envelope information for this message.
protected  boolean isREV1()
           
 boolean isSet(Flags.Flag flag)
          Test if the given Flags are set in this message.
 void removeHeader(String name)
          Remove all headers with this name.
 void setContentID(String cid)
          Set the "Content-ID" header field of this Message.
 void setContentLanguage(String[] languages)
          Set the "Content-Language" header of this MimePart.
 void setContentMD5(String md5)
          Set the "Content-MD5" header field of this Message.
 void setDataHandler(DataHandler content)
          This method provides the mechanism to set this part's content.
 void setDescription(String description, String charset)
          Set the "Content-Description" header field for this Message.
 void setDisposition(String disposition)
          Set the "Content-Disposition" header field of this Message.
protected  void setExpunged(boolean set)
          Sets the expunged flag for this Message.
 void setFileName(String filename)
          Set the filename associated with this part, if possible.
 void setFlags(Flags flag, boolean set)
          Set/Unset the given flags in this message.
 void setFrom(Address address)
          Set the RFC 822 "From" header field.
 void setHeader(String name, String value)
          Set the value for this header_name.
protected  void setMessageNumber(int msgnum)
          Wrapper around the protected method Message.setMessageNumber() to make that method accessible to IMAPFolder.
 void setPeek(boolean peek)
          Set whether or not to use the PEEK variant of FETCH when fetching message content.
 void setRecipients(Message.RecipientType type, Address[] addresses)
          Set the specified recipient type to the given addresses.
 void setReplyTo(Address[] addresses)
          Set the RFC 822 "Reply-To" header field.
 void setSender(Address address)
          Set the RFC 822 "Sender" header field.
 void setSentDate(Date d)
          Set the RFC 822 "Date" header field.
protected  void setSequenceNumber(int seqnum)
          Set this message's IMAP sequence number.
 void setSubject(String subject, String charset)
          Set the "Subject" header field.
protected  void setUID(long uid)
           
 void writeTo(OutputStream os)
          Write out the bytes into the given outputstream.
 
从类 javax.mail.internet.MimeMessage 继承的方法
addRecipients, createInternetHeaders, createMimeMessage, getAllRecipients, getContent, getInputStream, getRawInputStream, isMimeType, parse, reply, saveChanges, setContent, setContent, setDescription, setFrom, setRecipients, setSubject, setText, setText, setText, updateHeaders, updateMessageID, writeTo
 
从类 javax.mail.Message 继承的方法
addRecipient, getFolder, getMessageNumber, isExpunged, match, setFlag, setRecipient
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

bs

protected BODYSTRUCTURE bs

envelope

protected ENVELOPE envelope

sectionId

protected String sectionId
构造方法详细信息

IMAPMessage

protected IMAPMessage(IMAPFolder folder,
                      int msgnum,
                      int seqnum)
Constructor.


IMAPMessage

protected IMAPMessage(Session session)
Constructor, for use by IMAPNestedMessage.

方法详细信息

getProtocol

protected IMAPProtocol getProtocol()
                            throws ProtocolException,
                                   FolderClosedException
Get this message's folder's protocol connection. Throws FolderClosedException, if the protocol connection is not available. ASSERT: Must hold the messageCacheLock.

抛出:
ProtocolException
FolderClosedException

isREV1

protected boolean isREV1()
                  throws FolderClosedException
抛出:
FolderClosedException

getMessageCacheLock

protected Object getMessageCacheLock()
Get the messageCacheLock, associated with this Message's Folder.


getSequenceNumber

protected int getSequenceNumber()
Get this message's IMAP sequence number. ASSERT: This method must be called only when holding the messageCacheLock.


setSequenceNumber

protected void setSequenceNumber(int seqnum)
Set this message's IMAP sequence number. ASSERT: This method must be called only when holding the messageCacheLock.


setMessageNumber

protected void setMessageNumber(int msgnum)
Wrapper around the protected method Message.setMessageNumber() to make that method accessible to IMAPFolder.

覆盖:
Message 中的 setMessageNumber

getUID

protected long getUID()

setUID

protected void setUID(long uid)

setExpunged

protected void setExpunged(boolean set)
从类 Message 复制的描述
Sets the expunged flag for this Message. This method is to be used only by the implementation classes.

覆盖:
Message 中的 setExpunged
参数:
set - the expunged flag

checkExpunged

protected void checkExpunged()
                      throws MessageRemovedException
抛出:
MessageRemovedException

forceCheckExpunged

protected void forceCheckExpunged()
                           throws MessageRemovedException,
                                  FolderClosedException
Do a NOOP to force any untagged EXPUNGE responses and then check if this message is expunged.

抛出:
MessageRemovedException
FolderClosedException

getFetchBlockSize

protected int getFetchBlockSize()

getFrom

public Address[] getFrom()
                  throws MessagingException
Get the "From" attribute.

覆盖:
MimeMessage 中的 getFrom
返回:
Address object
抛出:
MessagingException
另请参见:
MimeMessage.headers

setFrom

public void setFrom(Address address)
             throws MessagingException
从类 MimeMessage 复制的描述
Set the RFC 822 "From" header field. Any existing values are replaced with the given address. If address is null, this header is removed.

覆盖:
MimeMessage 中的 setFrom
参数:
address - the sender of this message
抛出:
MessagingException
IllegalWriteException - if the underlying implementation does not support modification of existing values

addFrom

public void addFrom(Address[] addresses)
             throws MessagingException
从类 MimeMessage 复制的描述
Add the specified addresses to the existing "From" field. If the "From" field does not already exist, it is created.

覆盖:
MimeMessage 中的 addFrom
参数:
addresses - the senders of this message
抛出:
IllegalWriteException - if the underlying implementation does not support modification of existing values
MessagingException

getSender

public Address getSender()
                  throws MessagingException
Get the "Sender" attribute.

覆盖:
MimeMessage 中的 getSender
返回:
Address object
抛出:
MessagingException
另请参见:
MimeMessage.headers

setSender

public void setSender(Address address)
               throws MessagingException
从类 MimeMessage 复制的描述
Set the RFC 822 "Sender" header field. Any existing values are replaced with the given address. If address is null, this header is removed.

覆盖:
MimeMessage 中的 setSender
参数:
address - the sender of this message
抛出:
IllegalWriteException - if the underlying implementation does not support modification of existing values
MessagingException

getRecipients

public Address[] getRecipients(Message.RecipientType type)
                        throws MessagingException
Get the desired Recipient type.

覆盖:
MimeMessage 中的 getRecipients
参数:
type - Type of recepient
返回:
array of Address objects
抛出:
MessagingException - if header could not be retrieved
AddressException - if the header is misformatted
另请参见:
MimeMessage.headers, Message.RecipientType.TO, Message.RecipientType.CC, Message.RecipientType.BCC, MimeMessage.RecipientType.NEWSGROUPS

setRecipients

public void setRecipients(Message.RecipientType type,
                          Address[] addresses)
                   throws MessagingException
从类 MimeMessage 复制的描述
Set the specified recipient type to the given addresses. If the address parameter is null, the corresponding recipient field is removed.

覆盖:
MimeMessage 中的 setRecipients
参数:
type - Recipient type
addresses - Addresses
抛出:
MessagingException
IllegalWriteException - if the underlying implementation does not support modification of existing values
另请参见:
MimeMessage.getRecipients(javax.mail.Message.RecipientType)

addRecipients

public void addRecipients(Message.RecipientType type,
                          Address[] addresses)
                   throws MessagingException
从类 MimeMessage 复制的描述
Add the given addresses to the specified recipient type.

覆盖:
MimeMessage 中的 addRecipients
参数:
type - Recipient type
addresses - Addresses
抛出:
MessagingException
IllegalWriteException - if the underlying implementation does not support modification of existing values

getReplyTo

public Address[] getReplyTo()
                     throws MessagingException
Get the ReplyTo addresses.

覆盖:
MimeMessage 中的 getReplyTo
返回:
addresses to which replies should be directed
抛出:
MessagingException
另请参见:
MimeMessage.headers

setReplyTo

public void setReplyTo(Address[] addresses)
                throws MessagingException
从类 MimeMessage 复制的描述
Set the RFC 822 "Reply-To" header field. If the address parameter is null, this header is removed.

覆盖:
MimeMessage 中的 setReplyTo
参数:
addresses - addresses to which replies should be directed
抛出:
MessagingException
IllegalWriteException - if the underlying implementation does not support modification of existing values
MethodNotSupportedException - if the underlying implementation does not support setting this attribute

getSubject

public String getSubject()
                  throws MessagingException
Get the decoded subject.

覆盖:
MimeMessage 中的 getSubject
返回:
Subject
抛出:
MessagingException
另请参见:
MimeMessage.headers

setSubject

public void setSubject(String subject,
                       String charset)
                throws MessagingException
从类 MimeMessage 复制的描述
Set the "Subject" header field. If the subject contains non US-ASCII characters, it will be encoded using the specified charset. If the subject contains only US-ASCII characters, no encoding is done and it is used as-is. If the subject is null, the existing "Subject" header field is removed.

The application must ensure that the subject does not contain any line breaks.

Note that if the charset encoding process fails, a MessagingException is thrown, and an UnsupportedEncodingException is included in the chain of nested exceptions within the MessagingException.

覆盖:
MimeMessage 中的 setSubject
参数:
subject - The subject
charset - The charset
抛出:
IllegalWriteException - if the underlying implementation does not support modification of existing values
MessagingException

getSentDate

public Date getSentDate()
                 throws MessagingException
Get the SentDate.

覆盖:
MimeMessage 中的 getSentDate
返回:
The sent Date
抛出:
MessagingException

setSentDate

public void setSentDate(Date d)
                 throws MessagingException
从类 MimeMessage 复制的描述
Set the RFC 822 "Date" header field. This is the date on which the creator of the message indicates that the message is complete and ready for delivery. If the date parameter is null, the existing "Date" field is removed.

覆盖:
MimeMessage 中的 setSentDate
参数:
d - the sent date of this message
抛出:
MessagingException
IllegalWriteException - if the underlying implementation does not support modification of existing values

getReceivedDate

public Date getReceivedDate()
                     throws MessagingException
Get the recieved date (INTERNALDATE)

覆盖:
MimeMessage 中的 getReceivedDate
返回:
the date this message was received
抛出:
MessagingException

getSize

public int getSize()
            throws MessagingException
Get the message size.

Note that this returns RFC822.SIZE. That is, it's the size of the whole message, header and body included.

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

getLineCount

public int getLineCount()
                 throws MessagingException
Get the total number of lines.

Returns the "body_fld_lines" field from the BODYSTRUCTURE. Note that this field is available only for text/plain and message/rfc822 types

指定者:
接口 Part 中的 getLineCount
覆盖:
MimeMessage 中的 getLineCount
返回:
number of lines in the content.
抛出:
MessagingException

getContentLanguage

public String[] getContentLanguage()
                            throws MessagingException
Get the content language.

指定者:
接口 MimePart 中的 getContentLanguage
覆盖:
MimeMessage 中的 getContentLanguage
返回:
value of content-language header.
抛出:
MessagingException

setContentLanguage

public void setContentLanguage(String[] languages)
                        throws MessagingException
从类 MimeMessage 复制的描述
Set the "Content-Language" header of this MimePart. The Content-Language header is defined by RFC 1766.

指定者:
接口 MimePart 中的 setContentLanguage
覆盖:
MimeMessage 中的 setContentLanguage
参数:
languages - array of language tags
抛出:
IllegalWriteException - if the underlying implementation does not support modification
MessagingException

getInReplyTo

public String getInReplyTo()
                    throws MessagingException
Get the In-Reply-To header.

抛出:
MessagingException
从以下版本开始:
JavaMail 1.3.3

getContentType

public String getContentType()
                      throws MessagingException
Get the Content-Type. Generate this header from the BODYSTRUCTURE. Append parameters as well.

指定者:
接口 Part 中的 getContentType
覆盖:
MimeMessage 中的 getContentType
返回:
The ContentType of this part
抛出:
MessagingException
另请参见:
DataHandler

getDisposition

public String getDisposition()
                      throws MessagingException
Get the Content-Disposition.

指定者:
接口 Part 中的 getDisposition
覆盖:
MimeMessage 中的 getDisposition
返回:
disposition of this part, or null if unknown
抛出:
MessagingException
另请参见:
Part.ATTACHMENT, Part.INLINE, Part.getFileName()

setDisposition

public void setDisposition(String disposition)
                    throws MessagingException
从类 MimeMessage 复制的描述
Set the "Content-Disposition" header field of this Message. If disposition is null, any existing "Content-Disposition" header field is removed.

指定者:
接口 Part 中的 setDisposition
覆盖:
MimeMessage 中的 setDisposition
参数:
disposition - disposition of this part
抛出:
MessagingException
IllegalWriteException - if the underlying implementation does not support modification of this header
另请参见:
Part.ATTACHMENT, Part.INLINE, Part.setFileName(java.lang.String)

getEncoding

public String getEncoding()
                   throws MessagingException
Get the Content-Transfer-Encoding.

指定者:
接口 MimePart 中的 getEncoding
覆盖:
MimeMessage 中的 getEncoding
返回:
content-transfer-encoding
抛出:
MessagingException

getContentID

public String getContentID()
                    throws MessagingException
Get the Content-ID.

指定者:
接口 MimePart 中的 getContentID
覆盖:
MimeMessage 中的 getContentID
返回:
content-ID
抛出:
MessagingException

setContentID

public void setContentID(String cid)
                  throws MessagingException
从类 MimeMessage 复制的描述
Set the "Content-ID" header field of this Message. If the cid parameter is null, any existing "Content-ID" is removed.

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

getContentMD5

public String getContentMD5()
                     throws MessagingException
Get the Content-MD5.

指定者:
接口 MimePart 中的 getContentMD5
覆盖:
MimeMessage 中的 getContentMD5
返回:
content-MD5
抛出:
MessagingException

setContentMD5

public void setContentMD5(String md5)
                   throws MessagingException
从类 MimeMessage 复制的描述
Set the "Content-MD5" header field of this Message.

指定者:
接口 MimePart 中的 setContentMD5
覆盖:
MimeMessage 中的 setContentMD5
参数:
md5 - the MD5 value
抛出:
IllegalWriteException - if the underlying implementation does not support modification
MessagingException

getDescription

public String getDescription()
                      throws MessagingException
Get the decoded Content-Description.

指定者:
接口 Part 中的 getDescription
覆盖:
MimeMessage 中的 getDescription
返回:
content-description
抛出:
MessagingException

setDescription

public void setDescription(String description,
                           String charset)
                    throws MessagingException
从类 MimeMessage 复制的描述
Set the "Content-Description" header field for this Message. If the description parameter is null, then any existing "Content-Description" fields are removed.

If the description contains non US-ASCII characters, it will be encoded using the specified charset. If the description contains only US-ASCII characters, no encoding is done and it is used as-is.

Note that if the charset encoding process fails, a MessagingException is thrown, and an UnsupportedEncodingException is included in the chain of nested exceptions within the MessagingException.

覆盖:
MimeMessage 中的 setDescription
参数:
description - Description
charset - Charset for encoding
抛出:
IllegalWriteException - if the underlying implementation does not support modification
MessagingException

getMessageID

public String getMessageID()
                    throws MessagingException
Get the Message-ID.

覆盖:
MimeMessage 中的 getMessageID
返回:
Message-ID
抛出:
MessagingException - if the retrieval of this field causes any exception.
另请参见:
MessageIDTerm

getFileName

public String getFileName()
                   throws MessagingException
Get the "filename" Disposition parameter. (Only available in IMAP4rev1). If thats not available, get the "name" ContentType parameter.

指定者:
接口 Part 中的 getFileName
覆盖:
MimeMessage 中的 getFileName
返回:
filename
抛出:
MessagingException

setFileName

public void setFileName(String filename)
                 throws MessagingException
从类 MimeMessage 复制的描述
Set the filename associated with this part, if possible.

Sets the "filename" parameter of the "Content-Disposition" header field of this message.

If the mail.mime.encodefilename System property is set to true, the MimeUtility.encodeText method will be used to encode the filename. While such encoding is not supported by the MIME spec, many mailers use this technique to support non-ASCII characters in filenames. The default value of this property is false.

指定者:
接口 Part 中的 setFileName
覆盖:
MimeMessage 中的 setFileName
参数:
filename - Filename to associate with this part
抛出:
IllegalWriteException - if the underlying implementation does not support modification of this header
MessagingException

getContentStream

protected InputStream getContentStream()
                                throws MessagingException
Get all the bytes for this message. Overrides getContentStream() in MimeMessage. This method is ultimately used by the DataHandler to obtain the input stream for this message.

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

getDataHandler

public DataHandler getDataHandler()
                           throws MessagingException
Get the DataHandler object for this message.

指定者:
接口 Part 中的 getDataHandler
覆盖:
MimeMessage 中的 getDataHandler
返回:
DataHandler for the content
抛出:
MessagingException

setDataHandler

public void setDataHandler(DataHandler content)
                    throws MessagingException
从类 MimeMessage 复制的描述
This method provides the mechanism to set this part's content. The given DataHandler object should wrap the actual content.

指定者:
接口 Part 中的 setDataHandler
覆盖:
MimeMessage 中的 setDataHandler
参数:
content - The DataHandler for the content.
抛出:
MessagingException
IllegalWriteException - if the underlying implementation does not support modification of existing values

writeTo

public void writeTo(OutputStream os)
             throws IOException,
                    MessagingException
Write out the bytes into the given outputstream.

指定者:
接口 Part 中的 writeTo
覆盖:
MimeMessage 中的 writeTo
抛出:
IOException - if an error occurs writing to the stream or if an error is generated by the javax.activation layer.
MessagingException - if an error occurs fetching the data to be written
另请参见:
DataHandler.writeTo(java.io.OutputStream)

getHeader

public String[] getHeader(String name)
                   throws MessagingException
Get the named header.

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

getHeader

public String getHeader(String name,
                        String delimiter)
                 throws MessagingException
Get the named header.

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

setHeader

public void setHeader(String name,
                      String value)
               throws MessagingException
从类 MimeMessage 复制的描述
Set the value for this header_name. Replaces all existing header values with this new value. Note that RFC 822 headers must contain only US-ASCII characters, so a header that contains non US-ASCII characters must have been encoded by the caller as per the rules of RFC 2047.

指定者:
接口 Part 中的 setHeader
覆盖:
MimeMessage 中的 setHeader
参数:
name - header name
value - header value
抛出:
MessagingException
IllegalWriteException - if the underlying implementation does not support modification of existing values
另请参见:
MimeUtility

addHeader

public void addHeader(String name,
                      String value)
               throws MessagingException
从类 MimeMessage 复制的描述
Add this value to the existing values for this header_name. Note that RFC 822 headers must contain only US-ASCII characters, so a header that contains non US-ASCII characters must have been encoded as per the rules of RFC 2047.

指定者:
接口 Part 中的 addHeader
覆盖:
MimeMessage 中的 addHeader
参数:
name - header name
value - header value
抛出:
MessagingException
IllegalWriteException - if the underlying implementation does not support modification of existing values
另请参见:
MimeUtility

removeHeader

public void removeHeader(String name)
                  throws MessagingException
从类 MimeMessage 复制的描述
Remove all headers with this name.

指定者:
接口 Part 中的 removeHeader
覆盖:
MimeMessage 中的 removeHeader
参数:
name - the name of this header
抛出:
MessagingException
IllegalWriteException - if the underlying implementation does not support modification of existing values

getAllHeaders

public Enumeration getAllHeaders()
                          throws MessagingException
Get all headers.

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

getMatchingHeaders

public Enumeration getMatchingHeaders(String[] names)
                               throws MessagingException
Get matching headers.

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

getNonMatchingHeaders

public Enumeration getNonMatchingHeaders(String[] names)
                                  throws MessagingException
Get non-matching headers.

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

addHeaderLine

public void addHeaderLine(String line)
                   throws MessagingException
从类 MimeMessage 复制的描述
Add a raw RFC 822 header-line.

指定者:
接口 MimePart 中的 addHeaderLine
覆盖:
MimeMessage 中的 addHeaderLine
抛出:
IllegalWriteException - if the underlying implementation does not support modification
MessagingException

getAllHeaderLines

public Enumeration getAllHeaderLines()
                              throws MessagingException
Get all header-lines.

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

getMatchingHeaderLines

public Enumeration getMatchingHeaderLines(String[] names)
                                   throws MessagingException
Get all matching header-lines.

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

getNonMatchingHeaderLines

public Enumeration getNonMatchingHeaderLines(String[] names)
                                      throws MessagingException
Get all non-matching headerlines.

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

getFlags

public Flags getFlags()
               throws MessagingException
Get the Flags for this message.

覆盖:
MimeMessage 中的 getFlags
返回:
Flags object containing the flags for this message
抛出:
MessagingException
另请参见:
Flags

isSet

public boolean isSet(Flags.Flag flag)
              throws MessagingException
Test if the given Flags are set in this message.

覆盖:
MimeMessage 中的 isSet
参数:
flag - the flag
返回:
value of the specified flag for this message
抛出:
MessagingException
另请参见:
Flags.Flag, Flags.Flag.ANSWERED, Flags.Flag.DELETED, Flags.Flag.DRAFT, Flags.Flag.FLAGGED, Flags.Flag.RECENT, Flags.Flag.SEEN

setFlags

public void setFlags(Flags flag,
                     boolean set)
              throws MessagingException
Set/Unset the given flags in this message.

覆盖:
MimeMessage 中的 setFlags
参数:
flag - Flags object containing 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

setPeek

public void setPeek(boolean peek)
Set whether or not to use the PEEK variant of FETCH when fetching message content.

从以下版本开始:
JavaMail 1.3.3

getPeek

public boolean getPeek()
Get whether or not to use the PEEK variant of FETCH when fetching message content.

从以下版本开始:
JavaMail 1.3.3

invalidateHeaders

public void invalidateHeaders()
Invalidate cached header and envelope information for this message. Subsequent accesses of this information will cause it to be fetched from the server.

从以下版本开始:
JavaMail 1.3.3


Copyright © 2013. All Rights Reserved.