JavaMail 1.2
============
Following is a description of the new APIs that are being
introduced in JavaMail 1.2. The numbers in parentheses
are bug numbers; you can find more information about the
bug reports at:
http://developer.java.sun.com/developer/bugParade/index.html
Please send comments and feedback to javamail@sun.com.
===================================================================
1. New protected field and methods (4129743)
--------------------------------------------
To simplify creating subclasses of MimeMessage, the following
field and method that were previously private are now protected:
/**
* A flag indicating whether the message has been modified.
* If the message has not been modified, any data in the
* <code>content</code> array is assumed to be valid and is used
* directly in the <code>writeTo</code> method. This flag is
* set to true when an empty message is created or when the
* <code>saveChanges</code> method is called.
*/
protected boolean modified = false;
/**
* Parse the InputStream setting the <code>headers</code> and
* <code>content</code> fields appropriately. Also resets the
* <code>modified</code> flag. <p>
*
* This method is intended for use by subclasses that need to
* control when the InputStream is parsed.
*
* @param is The message input stream
* @exception MessagingException
*/
protected void parse(InputStream is) throws MessagingException
The javadocs for the following exsting methods have been updated to
describe the use of the modified flag:
/**
* Default constructor. An empty message object is created.
* The <code>headers</code> field is set to an empty InternetHeaders
* object. The <code>flags</code> field is set to an empty Flags
* object. The <code>modified</code> flag is set to true.
*/
public MimeMessage(Session session)
/**
* Output the message as an RFC 822 format stream, without
* specified headers. If the <code>modified</code> flag is not
* set and the <code>content</code> array is not null, the
* <code>content</code> array is written directly, after
* writing the appropriate message headers.
*
* @exception javax.mail.MessagingException
* @exception IOException if an error occurs writing to the stream
* or if an error is generated by the
* javax.activation layer.
* @see javax.activation.DataHandler#writeTo
*/
public void writeTo(OutputStream os, String[] ignoreList)
throws IOException, MessagingException
/**
* Updates the appropriate header fields of this message to be
* consistent with the message's contents. If this message is
* contained in a Folder, any changes made to this message are
* committed to the containing folder. <p>
*
* If any part of a message's headers or contents are changed,
* <code>saveChanges</code> must be called to ensure that those
* changes are permanent. Otherwise, any such modifications may or
* may not be saved, depending on the folder implementation. <p>
*
* Messages obtained from folders opened READ_ONLY should not be
* modified and saveChanges should not be called on such messages. <p>
*
* This method sets the <code>modified</code> flag to true and then
* calls the <code>updateHeaders<code> method.
*
* @exception IllegalWriteException if the underlying
* implementation does not support modification
* @exception IllegalStateException if this message is
* obtained from a READ_ONLY folder.
* @exception MessagingException
*/
public void saveChanges() throws MessagingException
The following method is added to MimeMessage:
/**
* Create and return an InternetHeaders object that loads the
* headers from the given InputStream. Subclasses can override
* this method to return a subclass of InternetHeaders, if
* necessary. This implementation simply constructs and returns
* an InternetHeaders object.
*
* @param is the InputStream to read the headers from
* @exception MessagingException
*/
protected InternetHeaders createInternetHeaders(InputStream is)
throws MessagingException
Likewise, to simplify creating subclasses of MimeMultipart, the parse
method is made protected:
/**
* Parse the InputStream from our DataSource, constructing the
* appropriate MimeBodyParts. The <code>parsed</code> flag is
* set to true, and if true on entry nothing is done. This
* method is called by all other methods that need data for
* the body parts, to make sure the data has been parsed.
*/
protected synchronized void parse() throws MessagingException
and the following protected methods are added:
/**
* Create and return an InternetHeaders object that loads the
* headers from the given InputStream. Subclasses can override
* this method to return a subclass of InternetHeaders, if
* necessary. This implementation simply constructs and returns
* an InternetHeaders object.
*
* @param is the InputStream to read the headers from
* @exception MessagingException
*/
protected InternetHeaders createInternetHeaders(InputStream is)
throws MessagingException
/**
* Create and return a MimeBodyPart object to represent a
* body part parsed from the InputStream. Subclasses can override
* this method to return a subclass of MimeBodyPart, if
* necessary. This implementation simply constructs and returns
* a MimeBodyPart object.
*
* @param headers the headers for the body part
* @param content the content ofthe body part
* @exception MessagingException
*/
protected MimeBodyPart createMimeBodyPart(InternetHeaders headers,
byte[] content) throws MessagingException
/**
* Create and return a MimeBodyPart object to represent a
* body part parsed from the InputStream. Subclasses can override
* this method to return a subclass of MimeBodyPart, if
* necessary. This implementation simply constructs and returns
* a MimeBodyPart object.
*
* @param is InputStream containing the body part
* @exception MessagingException
*/
protected MimeBodyPart createMimeBodyPart(InputStream is)
throws MessagingException
===================================================================
2. MimeMessage and MimeBodyPart getRawInputStream method (4124840)
------------------------------------------------------------------
In some cases it is desirable to get the data for a body part
before JavaMail attempts to decode it. This is particularly important
if the Content-Transfer-Encoding header is incorrect. (For example,
some mail software is known to use "7-bit" instead of the MIME
defined "7bit".) Access to this data is currently provided
through the protected getContentStream method. Since simply
making this method public has the potential to cause a source
incompatibility for any subclasses that declare this method as
protected, we instead add a new public method that calls this
protected method:
/**
* Return an InputStream to the raw data with any Content-Transfer-Encoding
* intact. This method is useful if the "Content-Transfer-Encoding"
* header is incorrect or corrupt, which would prevent the
* <code>getInputStream</code> method or <code>getContent</code> method
* from returning the correct data. In such a case the application may
* use this method and attempt to decode the raw data itsel
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
官网地址:http://www.oracle.com/technetwork/java/javasebusiness/downloads/java-archive-downloads-eeplat-419426.html#javamail-1.4.5-oth-JPR JavaMail API 1.4.5 You must accept the Oracle Binary Code License Agreement for Java EE Technologies to download this software. Accept License Agreement Decline License Agreement Thank you for accepting the Oracle Binary Code License Agreement for Java EE Technologies; you may now download this software. Product / File Description File Size Download JavaMail API 1.4.5 2.2 MB javamail1_4_5.zip Back to top
资源推荐
资源详情
资源评论
收起资源包目录
javamail API 1.4.5(jar包和相关文档,官网下载) (441个子文件)
build.bat 2KB
stylesheet.css 1KB
inherit.gif 57B
MessagingException.html 297KB
MimeMessage.html 186KB
IMAPMessage.html 140KB
IMAPFolder.html 138KB
index-7.html 130KB
Folder.html 119KB
MimeBodyPart.html 117KB
index-19.html 89KB
SMTPTransport.html 79KB
MailHandler.html 74KB
Message.html 67KB
POP3Message.html 65KB
Address.html 63KB
Message.html 63KB
Session.html 59KB
POP3Folder.html 58KB
serialized-form.html 58KB
Part.html 56KB
MimeUtility.html 53KB
IMAPStore.html 53KB
InternetAddress.html 51KB
Folder.html 49KB
MimeMultipart.html 48KB
SMTPMessage.html 47KB
index-13.html 46KB
MultipartReport.html 45KB
Service.html 44KB
MailSSLSocketFactory.html 42KB
SharedFileInputStream.html 41KB
package-use.html 40KB
MailDateFormat.html 36KB
MimePart.html 36KB
Store.html 36KB
InternetHeaders.html 35KB
MessageHeaders.html 34KB
index-1.html 33KB
POP3Store.html 33KB
overview-tree.html 32KB
index-3.html 32KB
index-18.html 30KB
Multipart.html 30KB
Flags.html 29KB
package-summary.html 28KB
SearchTerm.html 28KB
Transport.html 28KB
index-9.html 27KB
package-summary.html 27KB
URLName.html 27KB
ContentType.html 27KB
Session.html 27KB
TransportEvent.html 26KB
SendFailedException.html 26KB
PreencodedMimeBodyPart.html 26KB
NewsAddress.html 26KB
constant-values.html 26KB
Flags.html 26KB
Rights.html 26KB
Message.RecipientType.html 25KB
URLName.html 25KB
package-summary.html 24KB
FolderEvent.html 24KB
index-6.html 24KB
package-summary.html 24KB
SMTPSendFailedException.html 24KB
package-summary.html 24KB
SMTPSenderFailedException.html 23KB
SMTPAddressFailedException.html 23KB
ByteArrayDataSource.html 23KB
AddressException.html 23KB
ParameterList.html 23KB
DeliveryStatus.html 23KB
MessagingException.html 23KB
MimePartDataSource.html 22KB
MessageCountEvent.html 22KB
SMTPAddressSucceededException.html 22KB
ContentDisposition.html 22KB
InternetHeaders.html 22KB
HeaderTokenizer.html 22KB
SharedByteArrayInputStream.html 21KB
index-16.html 21KB
SMTPSSLTransport.html 21KB
DispositionNotification.html 21KB
index-5.html 20KB
Part.html 20KB
index-20.html 20KB
StringTerm.html 20KB
StoreEvent.html 20KB
MessageChangedEvent.html 20KB
Rights.Right.html 20KB
Message.RecipientType.html 20KB
index-14.html 20KB
DateTerm.html 19KB
RecipientStringTerm.html 19KB
FolderNotFoundException.html 19KB
Provider.html 19KB
IMAPSSLStore.html 19KB
index-4.html 19KB
共 441 条
- 1
- 2
- 3
- 4
- 5
redwarning2
- 粉丝: 6
- 资源: 18
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
前往页