|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectjavax.mail.Message
javax.mail.internet.MimeMessage
com.sun.mail.imap.IMAPMessage
public class IMAPMessage
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.
| 嵌套类摘要 |
|---|
| 从类 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 |
| 字段详细信息 |
|---|
protected BODYSTRUCTURE bs
protected ENVELOPE envelope
protected String sectionId
| 构造方法详细信息 |
|---|
protected IMAPMessage(IMAPFolder folder,
int msgnum,
int seqnum)
protected IMAPMessage(Session session)
| 方法详细信息 |
|---|
protected IMAPProtocol getProtocol()
throws ProtocolException,
FolderClosedException
ProtocolException
FolderClosedException
protected boolean isREV1()
throws FolderClosedException
FolderClosedExceptionprotected Object getMessageCacheLock()
protected int getSequenceNumber()
protected void setSequenceNumber(int seqnum)
protected void setMessageNumber(int msgnum)
Message 中的 setMessageNumberprotected long getUID()
protected void setUID(long uid)
protected void setExpunged(boolean set)
Message 复制的描述
Message 中的 setExpungedset - the expunged flag
protected void checkExpunged()
throws MessageRemovedException
MessageRemovedException
protected void forceCheckExpunged()
throws MessageRemovedException,
FolderClosedException
MessageRemovedException
FolderClosedExceptionprotected int getFetchBlockSize()
public Address[] getFrom()
throws MessagingException
MimeMessage 中的 getFromMessagingExceptionMimeMessage.headers
public void setFrom(Address address)
throws MessagingException
MimeMessage 复制的描述null,
this header is removed.
MimeMessage 中的 setFromaddress - the sender of this message
MessagingException
IllegalWriteException - if the underlying
implementation does not support modification
of existing values
public void addFrom(Address[] addresses)
throws MessagingException
MimeMessage 复制的描述
MimeMessage 中的 addFromaddresses - the senders of this message
IllegalWriteException - if the underlying
implementation does not support modification
of existing values
MessagingException
public Address getSender()
throws MessagingException
MimeMessage 中的 getSenderMessagingExceptionMimeMessage.headers
public void setSender(Address address)
throws MessagingException
MimeMessage 复制的描述null,
this header is removed.
MimeMessage 中的 setSenderaddress - the sender of this message
IllegalWriteException - if the underlying
implementation does not support modification
of existing values
MessagingException
public Address[] getRecipients(Message.RecipientType type)
throws MessagingException
MimeMessage 中的 getRecipientstype - Type of recepient
MessagingException - if header could not
be retrieved
AddressException - if the header is misformattedMimeMessage.headers,
Message.RecipientType.TO,
Message.RecipientType.CC,
Message.RecipientType.BCC,
MimeMessage.RecipientType.NEWSGROUPS
public void setRecipients(Message.RecipientType type,
Address[] addresses)
throws MessagingException
MimeMessage 复制的描述null, the corresponding
recipient field is removed.
MimeMessage 中的 setRecipientstype - Recipient typeaddresses - Addresses
MessagingException
IllegalWriteException - if the underlying
implementation does not support modification
of existing valuesMimeMessage.getRecipients(javax.mail.Message.RecipientType)
public void addRecipients(Message.RecipientType type,
Address[] addresses)
throws MessagingException
MimeMessage 复制的描述
MimeMessage 中的 addRecipientstype - Recipient typeaddresses - Addresses
MessagingException
IllegalWriteException - if the underlying
implementation does not support modification
of existing values
public Address[] getReplyTo()
throws MessagingException
MimeMessage 中的 getReplyToMessagingExceptionMimeMessage.headers
public void setReplyTo(Address[] addresses)
throws MessagingException
MimeMessage 复制的描述null, this header is removed.
MimeMessage 中的 setReplyToaddresses - 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
public String getSubject()
throws MessagingException
MimeMessage 中的 getSubjectMessagingExceptionMimeMessage.headers
public void setSubject(String subject,
String charset)
throws MessagingException
MimeMessage 复制的描述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 中的 setSubjectsubject - The subjectcharset - The charset
IllegalWriteException - if the underlying
implementation does not support modification
of existing values
MessagingException
public Date getSentDate()
throws MessagingException
MimeMessage 中的 getSentDateMessagingException
public void setSentDate(Date d)
throws MessagingException
MimeMessage 复制的描述null, the existing "Date" field is removed.
MimeMessage 中的 setSentDated - the sent date of this message
MessagingException
IllegalWriteException - if the underlying
implementation does not support modification
of existing values
public Date getReceivedDate()
throws MessagingException
MimeMessage 中的 getReceivedDateMessagingException
public int getSize()
throws MessagingException
Note that this returns RFC822.SIZE. That is, it's the size of the whole message, header and body included.
Part 中的 getSizeMimeMessage 中的 getSizeMessagingException
public int getLineCount()
throws MessagingException
Returns the "body_fld_lines" field from the BODYSTRUCTURE. Note that this field is available only for text/plain and message/rfc822 types
Part 中的 getLineCountMimeMessage 中的 getLineCountMessagingException
public String[] getContentLanguage()
throws MessagingException
MimePart 中的 getContentLanguageMimeMessage 中的 getContentLanguageMessagingException
public void setContentLanguage(String[] languages)
throws MessagingException
MimeMessage 复制的描述
MimePart 中的 setContentLanguageMimeMessage 中的 setContentLanguagelanguages - array of language tags
IllegalWriteException - if the underlying
implementation does not support modification
MessagingException
public String getInReplyTo()
throws MessagingException
MessagingException
public String getContentType()
throws MessagingException
Part 中的 getContentTypeMimeMessage 中的 getContentTypeMessagingExceptionDataHandler
public String getDisposition()
throws MessagingException
Part 中的 getDispositionMimeMessage 中的 getDispositionMessagingExceptionPart.ATTACHMENT,
Part.INLINE,
Part.getFileName()
public void setDisposition(String disposition)
throws MessagingException
MimeMessage 复制的描述disposition is null, any existing "Content-Disposition"
header field is removed.
Part 中的 setDispositionMimeMessage 中的 setDispositiondisposition - disposition of this part
MessagingException
IllegalWriteException - if the underlying implementation
does not support modification of this headerPart.ATTACHMENT,
Part.INLINE,
Part.setFileName(java.lang.String)
public String getEncoding()
throws MessagingException
MimePart 中的 getEncodingMimeMessage 中的 getEncodingMessagingException
public String getContentID()
throws MessagingException
MimePart 中的 getContentIDMimeMessage 中的 getContentIDMessagingException
public void setContentID(String cid)
throws MessagingException
MimeMessage 复制的描述cid parameter is null, any existing
"Content-ID" is removed.
MimeMessage 中的 setContentIDIllegalWriteException - if the underlying
implementation does not support modification
MessagingException
public String getContentMD5()
throws MessagingException
MimePart 中的 getContentMD5MimeMessage 中的 getContentMD5MessagingException
public void setContentMD5(String md5)
throws MessagingException
MimeMessage 复制的描述
MimePart 中的 setContentMD5MimeMessage 中的 setContentMD5md5 - the MD5 value
IllegalWriteException - if the underlying
implementation does not support modification
MessagingException
public String getDescription()
throws MessagingException
Part 中的 getDescriptionMimeMessage 中的 getDescriptionMessagingException
public void setDescription(String description,
String charset)
throws MessagingException
MimeMessage 复制的描述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 中的 setDescriptiondescription - Descriptioncharset - Charset for encoding
IllegalWriteException - if the underlying
implementation does not support modification
MessagingException
public String getMessageID()
throws MessagingException
MimeMessage 中的 getMessageIDMessagingException - if the retrieval of this field
causes any exception.MessageIDTerm
public String getFileName()
throws MessagingException
Part 中的 getFileNameMimeMessage 中的 getFileNameMessagingException
public void setFileName(String filename)
throws MessagingException
MimeMessage 复制的描述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 中的 setFileNameMimeMessage 中的 setFileNamefilename - Filename to associate with this part
IllegalWriteException - if the underlying implementation
does not support modification of this header
MessagingException
protected InputStream getContentStream()
throws MessagingException
MimeMessage 中的 getContentStreamMessagingExceptionMimeMessage.getContentStream()
public DataHandler getDataHandler()
throws MessagingException
Part 中的 getDataHandlerMimeMessage 中的 getDataHandlerMessagingException
public void setDataHandler(DataHandler content)
throws MessagingException
MimeMessage 复制的描述
Part 中的 setDataHandlerMimeMessage 中的 setDataHandlercontent - The DataHandler for the content.
MessagingException
IllegalWriteException - if the underlying implementation
does not support modification of existing values
public void writeTo(OutputStream os)
throws IOException,
MessagingException
Part 中的 writeToMimeMessage 中的 writeToIOException - 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 writtenDataHandler.writeTo(java.io.OutputStream)
public String[] getHeader(String name)
throws MessagingException
Part 中的 getHeaderMimeMessage 中的 getHeadername - name of header
MessagingExceptionMimeUtility
public String getHeader(String name,
String delimiter)
throws MessagingException
MimePart 中的 getHeaderMimeMessage 中的 getHeadername - the name of this headerdelimiter - separator between values
MessagingException
public void setHeader(String name,
String value)
throws MessagingException
MimeMessage 复制的描述
Part 中的 setHeaderMimeMessage 中的 setHeadername - header namevalue - header value
MessagingException
IllegalWriteException - if the underlying
implementation does not support modification
of existing valuesMimeUtility
public void addHeader(String name,
String value)
throws MessagingException
MimeMessage 复制的描述
Part 中的 addHeaderMimeMessage 中的 addHeadername - header namevalue - header value
MessagingException
IllegalWriteException - if the underlying
implementation does not support modification
of existing valuesMimeUtility
public void removeHeader(String name)
throws MessagingException
MimeMessage 复制的描述
Part 中的 removeHeaderMimeMessage 中的 removeHeadername - the name of this header
MessagingException
IllegalWriteException - if the underlying
implementation does not support modification
of existing values
public Enumeration getAllHeaders()
throws MessagingException
Part 中的 getAllHeadersMimeMessage 中的 getAllHeadersMessagingExceptionMimeUtility
public Enumeration getMatchingHeaders(String[] names)
throws MessagingException
Part 中的 getMatchingHeadersMimeMessage 中的 getMatchingHeadersMessagingException
public Enumeration getNonMatchingHeaders(String[] names)
throws MessagingException
Part 中的 getNonMatchingHeadersMimeMessage 中的 getNonMatchingHeadersMessagingException
public void addHeaderLine(String line)
throws MessagingException
MimeMessage 复制的描述
MimePart 中的 addHeaderLineMimeMessage 中的 addHeaderLineIllegalWriteException - if the underlying
implementation does not support modification
MessagingException
public Enumeration getAllHeaderLines()
throws MessagingException
MimePart 中的 getAllHeaderLinesMimeMessage 中的 getAllHeaderLinesMessagingException
public Enumeration getMatchingHeaderLines(String[] names)
throws MessagingException
MimePart 中的 getMatchingHeaderLinesMimeMessage 中的 getMatchingHeaderLinesMessagingException
public Enumeration getNonMatchingHeaderLines(String[] names)
throws MessagingException
MimePart 中的 getNonMatchingHeaderLinesMimeMessage 中的 getNonMatchingHeaderLinesMessagingException
public Flags getFlags()
throws MessagingException
MimeMessage 中的 getFlagsMessagingExceptionFlags
public boolean isSet(Flags.Flag flag)
throws MessagingException
MimeMessage 中的 isSetflag - the flag
MessagingExceptionFlags.Flag,
Flags.Flag.ANSWERED,
Flags.Flag.DELETED,
Flags.Flag.DRAFT,
Flags.Flag.FLAGGED,
Flags.Flag.RECENT,
Flags.Flag.SEEN
public void setFlags(Flags flag,
boolean set)
throws MessagingException
MimeMessage 中的 setFlagsflag - Flags object containing the flags to be setset - the value to be set
MessagingException
IllegalWriteException - if the underlying
implementation does not support modification
of existing values.MessageChangedEventpublic void setPeek(boolean peek)
public boolean getPeek()
public void invalidateHeaders()
|
||||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||