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
没有合适的资源?快使用搜索试试~ 我知道了~
温馨提示
嵌入式优质项目,资源经过严格测试可直接运行成功且功能正常的情况才上传,可轻松copy复刻,拿到资料包后可轻松复现出一样的项目。 本人单片机开发经验充足,深耕嵌入式领域,有任何使用问题欢迎随时与我联系,我会及时为你解惑,提供帮助。 【资源内容】:包含完整源码+工程文件+说明,项目具体内容可查看下方的资源详情。 【附带帮助】: 若还需要嵌入式物联网单片机相关领域开发工具、学习资料等,我会提供帮助,提供资料,鼓励学习进步。 【本人专注嵌入式领域】: 有任何使用问题欢迎随时与我联系,我会及时解答,第一时间为你提供帮助,CSDN博客端可私信,为你解惑,欢迎交流。 【建议小白】: 在所有嵌入式开发中硬件部分若不会画PCB/电路,可选择根据引脚定义将其代替为面包板+杜邦线+外设模块的方式,只需轻松简单连线,下载源码烧录进去便可轻松复刻出一样的项目 【适合场景】: 相关项目设计中,皆可应用在项目开发、毕业设计、课程设计、期末/期中/大作业、工程实训、大创等学科竞赛比赛、初期项目立项、学习/练手等方面中 可借鉴此优质项目实现复刻,也可以基于此项目进行扩展来开发出更多功能
资源推荐
资源详情
资源评论
收起资源包目录
基于stm32设计的闹钟发生通过串口与电脑通信然后电脑发送邮件.zip(毕设/课设/竞赛/实训/项目开发) (545个子文件)
AlarmProject.axf 228KB
build.bat 2KB
system_stm32f10x.c 35KB
delay.c 7KB
sys.c 6KB
usart.c 4KB
clock.c 3KB
uartContact.c 3KB
setNVIC.c 904B
beep.c 353B
main.c 149B
ContactByUart.class 5KB
ContactByUart.class 5KB
SendEmail.class 2KB
SendEmail$1.class 766B
test.class 652B
.classpath 416B
.classpath 374B
sys.crf 221KB
uartcontact.crf 220KB
clock.crf 220KB
main.crf 219KB
beep.crf 219KB
system_stm32f10x.crf 219KB
setnvic.crf 217KB
stylesheet.css 11KB
uartcontact.d 388B
clock.d 365B
main.d 359B
beep.d 318B
system_stm32f10x.d 292B
setnvic.d 278B
sys.d 250B
startup_stm32f10x_hd.d 58B
AlarmProject_Target 1.dep 5KB
titlebar.gif 10KB
background.gif 2KB
titlebar_end.gif 849B
tab.gif 291B
stm32f10x.h 611KB
core_cm3.h 82KB
core_cmInstr.h 25KB
core_cmFunc.h 16KB
sys.h 4KB
clock.h 2KB
system_stm32f10x.h 2KB
delay.h 2KB
usart.h 1KB
beep.h 262B
setNVIC.h 246B
uartContact.h 227B
stm32f10x_conf.h 0B
main.h 0B
AlarmProject.hex 8KB
AlarmProject.htm 38KB
AlarmProject.build_log.htm 1KB
MessagingException.html 272KB
MimeMessage.html 189KB
index-7.html 160KB
IMAPMessage.html 151KB
IMAPFolder.html 147KB
Folder.html 121KB
MimeBodyPart.html 117KB
index-19.html 103KB
SMTPTransport.html 79KB
MailHandler.html 76KB
Message.html 66KB
POP3Message.html 64KB
IMAPStore.html 62KB
Message.html 60KB
Session.html 59KB
Address.html 58KB
POP3Folder.html 58KB
Part.html 56KB
MimeUtility.html 53KB
index-13.html 53KB
InternetAddress.html 50KB
MimeMultipart.html 48KB
serialized-form.html 46KB
Folder.html 46KB
SMTPMessage.html 45KB
MultipartReport.html 43KB
Service.html 43KB
SharedFileInputStream.html 41KB
MailSSLSocketFactory.html 40KB
package-use.html 37KB
overview-tree.html 37KB
index-1.html 37KB
Store.html 35KB
MimePart.html 35KB
index-3.html 35KB
InternetHeaders.html 35KB
MailDateFormat.html 34KB
index-18.html 33KB
MessageHeaders.html 32KB
index-9.html 32KB
POP3Store.html 32KB
GmailMessage.html 30KB
GmailStore.html 29KB
GmailFolder.html 29KB
共 545 条
- 1
- 2
- 3
- 4
- 5
- 6
资源评论
阿齐Archie
- 粉丝: 1w+
- 资源: 2303
下载权益
C知道特权
VIP文章
课程特权
开通VIP
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功