📄 mimemultipart.html
字号:
<DL><DD>Get the specified BodyPart. BodyParts are numbered starting at 0.<P><DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../javax/mail/Multipart.html#getBodyPart(int)">getBodyPart</A></CODE> in class <CODE><A HREF="../../../javax/mail/Multipart.html" title="class in javax.mail">Multipart</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>index</CODE> - the index of the desired BodyPart<DT><B>Returns:</B><DD>the Part<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></CODE> - if no such BodyPart exists</DL></DD></DL><HR><A NAME="getBodyPart(java.lang.String)"><!-- --></A><H3>getBodyPart</H3><PRE>public <A HREF="../../../javax/mail/BodyPart.html" title="class in javax.mail">BodyPart</A> <B>getBodyPart</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> CID) throws <A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></PRE><DL><DD>Get the MimeBodyPart referred to by the given ContentID (CID). Returns null if the part is not found.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>CID</CODE> - the ContentID of the desired part<DT><B>Returns:</B><DD>the Part<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></CODE></DL></DD></DL><HR><A NAME="updateHeaders()"><!-- --></A><H3>updateHeaders</H3><PRE>protected void <B>updateHeaders</B>() throws <A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></PRE><DL><DD>Update headers. The default implementation here just calls the <code>updateHeaders</code> method on each of its children BodyParts. <p> Note that the boundary parameter is already set up when a new and empty MimeMultipart object is created. <p> This method is called when the <code>saveChanges</code> method is invoked on the Message object containing this Multipart. This is typically done as part of the Message send process, however note that a client is free to call it any number of times. So if the header updating process is expensive for a specific MimeMultipart subclass, then it might itself want to track whether its internal state actually did change, and do the header updating only if necessary.<P><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></CODE></DL></DD></DL><HR><A NAME="writeTo(java.io.OutputStream)"><!-- --></A><H3>writeTo</H3><PRE>public void <B>writeTo</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/OutputStream.html" title="class or interface in java.io">OutputStream</A> os) throws <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A>, <A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></PRE><DL><DD>Iterates through all the parts and outputs each Mime part separated by a boundary.<P><DD><DL><DT><B>Specified by:</B><DD><CODE><A HREF="../../../javax/mail/Multipart.html#writeTo(java.io.OutputStream)">writeTo</A></CODE> in class <CODE><A HREF="../../../javax/mail/Multipart.html" title="class in javax.mail">Multipart</A></CODE></DL></DD><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></CODE><DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/IOException.html" title="class or interface in java.io">IOException</A></CODE> - if an IO related exception occurs</DL></DD></DL><HR><A NAME="parse()"><!-- --></A><H3>parse</H3><PRE>protected void <B>parse</B>() throws <A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></PRE><DL><DD>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.<P><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></CODE><DT><B>Since:</B></DT> <DD>JavaMail 1.2</DD></DL></DD></DL><HR><A NAME="createInternetHeaders(java.io.InputStream)"><!-- --></A><H3>createInternetHeaders</H3><PRE>protected <A HREF="../../../javax/mail/internet/InternetHeaders.html" title="class in javax.mail.internet">InternetHeaders</A> <B>createInternetHeaders</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/InputStream.html" title="class or interface in java.io">InputStream</A> is) throws <A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></PRE><DL><DD>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.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>is</CODE> - the InputStream to read the headers from<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></CODE><DT><B>Since:</B></DT> <DD>JavaMail 1.2</DD></DL></DD></DL><HR><A NAME="createMimeBodyPart(javax.mail.internet.InternetHeaders, byte[])"><!-- --></A><H3>createMimeBodyPart</H3><PRE>protected <A HREF="../../../javax/mail/internet/MimeBodyPart.html" title="class in javax.mail.internet">MimeBodyPart</A> <B>createMimeBodyPart</B>(<A HREF="../../../javax/mail/internet/InternetHeaders.html" title="class in javax.mail.internet">InternetHeaders</A> headers, byte[] content) throws <A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></PRE><DL><DD>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.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>headers</CODE> - the headers for the body part<DD><CODE>content</CODE> - the content of the body part<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></CODE><DT><B>Since:</B></DT> <DD>JavaMail 1.2</DD></DL></DD></DL><HR><A NAME="createMimeBodyPart(java.io.InputStream)"><!-- --></A><H3>createMimeBodyPart</H3><PRE>protected <A HREF="../../../javax/mail/internet/MimeBodyPart.html" title="class in javax.mail.internet">MimeBodyPart</A> <B>createMimeBodyPart</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/InputStream.html" title="class or interface in java.io">InputStream</A> is) throws <A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></PRE><DL><DD>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.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>is</CODE> - InputStream containing the body part<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></CODE><DT><B>Since:</B></DT> <DD>JavaMail 1.2</DD></DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ======= START OF BOTTOM NAVBAR ====== --><A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Java<sup><font size=-2>TM</font></sup> 2 Platform<br>Ent. Ed. v1.4</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../javax/mail/internet/MimeMessage.RecipientType.html" title="class in javax.mail.internet"><B>PREV CLASS</B></A> <A HREF="../../../javax/mail/internet/MimePartDataSource.html" title="class in javax.mail.internet"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" target="_top"><B>FRAMES</B></A> <A HREF="MimeMultipart.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--></SCRIPT><NOSCRIPT> <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR><font size="-1"><a href="http://java.sun.com/webapps/bugreport">Submit a bug or feature</a> <p>Copyright 2003 Sun Microsystems, Inc. All rights reserved.</font></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -