📄 mimemultipart.html
字号:
body part parsed from the InputStream. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../javax/mail/BodyPart.html" title="class in javax.mail">BodyPart</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMultipart.html#getBodyPart(int)">getBodyPart</A></B>(int index)</CODE><BR> Get the specified BodyPart. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="../../../javax/mail/BodyPart.html" title="class in javax.mail">BodyPart</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMultipart.html#getBodyPart(java.lang.String)">getBodyPart</A></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)</CODE><BR> Get the MimeBodyPart referred to by the given ContentID (CID). </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMultipart.html#getCount()">getCount</A></B>()</CODE><BR> Return the number of enclosed BodyPart objects.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMultipart.html#parse()">parse</A></B>()</CODE><BR> Parse the InputStream from our DataSource, constructing the appropriate MimeBodyParts. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMultipart.html#setSubType(java.lang.String)">setSubType</A></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> subtype)</CODE><BR> Set the subtype. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMultipart.html#updateHeaders()">updateHeaders</A></B>()</CODE><BR> Update headers. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> void</CODE></FONT></TD><TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMultipart.html#writeTo(java.io.OutputStream)">writeTo</A></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)</CODE><BR> Iterates through all the parts and outputs each Mime part separated by a boundary.</TD></TR></TABLE> <A NAME="methods_inherited_from_class_javax.mail.Multipart"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class javax.mail.<A HREF="../../../javax/mail/Multipart.html" title="class in javax.mail">Multipart</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="../../../javax/mail/Multipart.html#addBodyPart(javax.mail.BodyPart)">addBodyPart</A>, <A HREF="../../../javax/mail/Multipart.html#addBodyPart(javax.mail.BodyPart, int)">addBodyPart</A>, <A HREF="../../../javax/mail/Multipart.html#getContentType()">getContentType</A>, <A HREF="../../../javax/mail/Multipart.html#getParent()">getParent</A>, <A HREF="../../../javax/mail/Multipart.html#removeBodyPart(javax.mail.BodyPart)">removeBodyPart</A>, <A HREF="../../../javax/mail/Multipart.html#removeBodyPart(int)">removeBodyPart</A>, <A HREF="../../../javax/mail/Multipart.html#setMultipartDataSource(javax.mail.MultipartDataSource)">setMultipartDataSource</A>, <A HREF="../../../javax/mail/Multipart.html#setParent(javax.mail.Part)">setParent</A></CODE></TD></TR></TABLE> <A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor"><TD><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A></B></TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><A NAME="field_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Field Detail</B></FONT></TD></TR></TABLE><A NAME="ds"><!-- --></A><H3>ds</H3><PRE>protected <A HREF="../../../javax/activation/DataSource.html" title="interface in javax.activation">DataSource</A> <B>ds</B></PRE><DL><DD>The DataSource supplying our InputStream.<P><DL></DL></DL><HR><A NAME="parsed"><!-- --></A><H3>parsed</H3><PRE>protected boolean <B>parsed</B></PRE><DL><DD>Have we parsed the data from our InputStream yet? Defaults to true; set to false when our constructor is given a DataSource with an InputStream that we need to parse.<P><DL></DL></DL><!-- ========= CONSTRUCTOR DETAIL ======== --><A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TD></TR></TABLE><A NAME="MimeMultipart()"><!-- --></A><H3>MimeMultipart</H3><PRE>public <B>MimeMultipart</B>()</PRE><DL><DD>Default constructor. An empty MimeMultipart object is created. Its content type is set to "multipart/mixed". A unique boundary string is generated and this string is setup as the "boundary" parameter for the <code>contentType</code> field. <p> MimeBodyParts may be added later.<P></DL><HR><A NAME="MimeMultipart(java.lang.String)"><!-- --></A><H3>MimeMultipart</H3><PRE>public <B>MimeMultipart</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> subtype)</PRE><DL><DD>Construct a MimeMultipart object of the given subtype. A unique boundary string is generated and this string is setup as the "boundary" parameter for the <code>contentType</code> field. <p> MimeBodyParts may be added later.<P></DL><HR><A NAME="MimeMultipart(javax.activation.DataSource)"><!-- --></A><H3>MimeMultipart</H3><PRE>public <B>MimeMultipart</B>(<A HREF="../../../javax/activation/DataSource.html" title="interface in javax.activation">DataSource</A> ds) throws <A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></PRE><DL><DD>Constructs a MimeMultipart object and its bodyparts from the given DataSource. <p> This constructor handles as a special case the situation where the given DataSource is a MultipartDataSource object. In this case, this method just invokes the superclass (i.e., Multipart) constructor that takes a MultipartDataSource object. <p> Otherwise, the DataSource is assumed to provide a MIME multipart byte stream. The <code>parsed</code> flag is set to false. When the data for the body parts are needed, the parser extracts the "boundary" parameter from the content type of this DataSource, skips the 'preamble' and reads bytes till the terminating boundary and creates MimeBodyParts for each part of the stream.<P><DT><B>Parameters:</B><DD><CODE>ds</CODE> - DataSource, can be a MultipartDataSource</DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="setSubType(java.lang.String)"><!-- --></A><H3>setSubType</H3><PRE>public void <B>setSubType</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> subtype) throws <A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></PRE><DL><DD>Set the subtype. This method should be invoked only on a new MimeMultipart object created by the client. The default subtype of such a multipart object is "mixed". <p><P><DD><DL><DT><B>Parameters:</B><DD><CODE>subtype</CODE> - Subtype<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="getCount()"><!-- --></A><H3>getCount</H3><PRE>public int <B>getCount</B>() throws <A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></PRE><DL><DD>Return the number of enclosed BodyPart objects.<P><DD><DL><DT><B>Overrides:</B><DD><CODE><A HREF="../../../javax/mail/Multipart.html#getCount()">getCount</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>Returns:</B><DD>number of parts<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></CODE><DT><B>See Also:</B><DD><A HREF="../../../javax/mail/Multipart.html#parts"><CODE>Multipart.parts</CODE></A></DL></DD></DL><HR><A NAME="getBodyPart(int)"><!-- --></A><H3>getBodyPart</H3><PRE>public <A HREF="../../../javax/mail/BodyPart.html" title="class in javax.mail">BodyPart</A> <B>getBodyPart</B>(int index) throws <A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></PRE>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -