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
没有合适的资源?快使用搜索试试~ 我知道了~
javaMail,java中邮件所需的jar包
共441个文件
html:348个
java:49个
txt:19个
3星 · 超过75%的资源 需积分: 47 10 下载量 26 浏览量
2012-11-03
15:35:53
上传
评论
收藏 2.21MB ZIP 举报
温馨提示
用于java中邮件发送所需要的jar包 ,例如:邮箱验证机制 ,邮箱信息提供等等
资源推荐
资源详情
资源评论
收起资源包目录
javaMail,java中邮件所需的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
StoreEvent.html 20KB
StringTerm.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
资源评论
- zoulingjunlove2013-08-14可以用可以用
- ttcike0072012-11-27不是我想要的
Waiting
- 粉丝: 73
- 资源: 17
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
最新资源
- 基于python的高性能爬虫程序,使用了多线程+缓存+xpath实现的,这里以彼-岸图库为例,实现,仅用于学习交流
- 中分辨率成像光谱仪(MODIS)烧毁面积产品信息MODIS-C6-BA-User-Guide-1.2.pdf
- Screenshot_20240427_172613_com.huawei.browser.jpg
- 关于学习Python的相关资源网站链接及相关介绍.docx
- (HAL库)基于STM32F103C8T6的温控PID系统[Dht11、ESP8266、无线透传、L298N……]
- VoLTE高丢包优化指导书.xlsx
- Rust资源文件.zip
- 前后端分离实践:使用 React 和 Express 搭建完整登录注册流程
- gradle-publish-to-MavenLocal.zip
- 10份网络优化创新案例.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功