mimemultipart.html

来自「SUN公司官方J2EE中文帮助文档 应该不错 有兴趣的下来看看 html格式的」· HTML 代码 · 共 598 行 · 第 1/2 页

HTML
598
字号
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Frameset//EN""http://www.w3.org/TR/REC-html40/frameset.dtd">
<!--NewPage-->
<HTML>
<HEAD>
<!-- Generated by javadoc on Thu Jan 17 03:51:35 PST 2002 -->
<TITLE>
Java 2 Platform EE v1.3: Class  MimeMultipart
</TITLE>
<LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
</HEAD>
<BODY BGCOLOR="white">

<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_top"><!-- --></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<A NAME="navbar_top_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  </TR>
</TABLE>
</TD>
<TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
</EM>
</TD>
</TR>

<TR>
<TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../javax/mail/internet/MimeMessage.RecipientType.html"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../javax/mail/internet/MimePartDataSource.html"><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>  &nbsp;
&nbsp;<A HREF="MimeMultipart.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  SUMMARY: &nbsp;INNER&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
DETAIL: &nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->

<HR>
<!-- ======== START OF CLASS DATA ======== -->
<H2>
<FONT SIZE="-1">
javax.mail.internet</FONT>
<BR>
Class  MimeMultipart</H2>
<PRE>
java.lang.Object
  |
  +--<A HREF="../../../javax/mail/Multipart.html">javax.mail.Multipart</A>
        |
        +--<B>javax.mail.internet.MimeMultipart</B>
</PRE>
<HR>
<DL>
<DT>public class <B>MimeMultipart</B><DT>extends <A HREF="../../../javax/mail/Multipart.html">Multipart</A></DL>

<P>
The MimeMultipart class is an implementation of the abstract Multipart
 class that uses MIME conventions for the multipart data. <p>

 A MimeMultipart is obtained from a MimePart whose primary type
 is "multipart" (by invoking the part's <code>getContent()</code> method)
 or it can be created by a client as part of creating a new MimeMessage. <p>

 The default multipart subtype is "mixed".  The other multipart
 subtypes, such as "alternative", "related", and so on, can be
 implemented as subclasses of MimeMultipart with additional methods
 to implement the additional semantics of that type of multipart
 content. The intent is that service providers, mail JavaBean writers
 and mail clients will write many such subclasses and their Command
 Beans, and will install them into the JavaBeans Activation
 Framework, so that any JavaMail implementation and its clients can
 transparently find and use these classes. Thus, a MIME multipart
 handler is treated just like any other type handler, thereby
 decoupling the process of providing multipart handlers from the
 JavaMail API. Lacking these additional MimeMultipart subclasses,
 all subtypes of MIME multipart data appear as MimeMultipart objects. <p>

 An application can directly construct a MIME multipart object of any
 subtype by using the <code>MimeMultipart(String subtype)</code>
 constructor.  For example, to create a "multipart/alternative" object,
 use <code>new MimeMultipart("alternative")</code>.
<P>
<HR>

<P>
<!-- ======== INNER CLASS SUMMARY ======== -->


<!-- =========== FIELD SUMMARY =========== -->

<A NAME="field_summary"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Field Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;<A HREF="../../../javax/activation/DataSource.html">DataSource</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMultipart.html#ds">ds</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The DataSource supplying our InputStream.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;boolean</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMultipart.html#parsed">parsed</A></B></CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="fields_inherited_from_class_javax.mail.Multipart"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Fields inherited from class javax.mail.<A HREF="../../../javax/mail/Multipart.html">Multipart</A></B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../javax/mail/Multipart.html#contentType">contentType</A>, <A HREF="../../../javax/mail/Multipart.html#parent">parent</A>, <A HREF="../../../javax/mail/Multipart.html#parts">parts</A></CODE></TD>
</TR>
</TABLE>
&nbsp;
<!-- ======== CONSTRUCTOR SUMMARY ======== -->

<A NAME="constructor_summary"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Constructor Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMultipart.html#MimeMultipart()">MimeMultipart</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Default constructor.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMultipart.html#MimeMultipart(javax.activation.DataSource)">MimeMultipart</A></B>(<A HREF="../../../javax/activation/DataSource.html">DataSource</A>&nbsp;ds)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructs a MimeMultipart object and its bodyparts from the 
 given DataSource.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMultipart.html#MimeMultipart(java.lang.String)">MimeMultipart</A></B>(java.lang.String&nbsp;subtype)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Construct a MimeMultipart object of the given subtype.</TD>
</TR>
</TABLE>
&nbsp;
<!-- ========== METHOD SUMMARY =========== -->

<A NAME="method_summary"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=2><FONT SIZE="+2">
<B>Method Summary</B></FONT></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;<A HREF="../../../javax/mail/internet/InternetHeaders.html">InternetHeaders</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMultipart.html#createInternetHeaders(java.io.InputStream)">createInternetHeaders</A></B>(java.io.InputStream&nbsp;is)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create and return an InternetHeaders object that loads the
 headers from the given InputStream.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;<A HREF="../../../javax/mail/internet/MimeBodyPart.html">MimeBodyPart</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMultipart.html#createMimeBodyPart(java.io.InputStream)">createMimeBodyPart</A></B>(java.io.InputStream&nbsp;is)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create and return a MimeBodyPart object to represent a
 body part parsed from the InputStream.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;<A HREF="../../../javax/mail/internet/MimeBodyPart.html">MimeBodyPart</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMultipart.html#createMimeBodyPart(javax.mail.internet.InternetHeaders, byte[])">createMimeBodyPart</A></B>(<A HREF="../../../javax/mail/internet/InternetHeaders.html">InternetHeaders</A>&nbsp;headers,
                   byte[]&nbsp;content)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create and return a MimeBodyPart object to represent a
 body part parsed from the InputStream.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../javax/mail/BodyPart.html">BodyPart</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMultipart.html#getBodyPart(int)">getBodyPart</A></B>(int&nbsp;index)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the specified BodyPart.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;<A HREF="../../../javax/mail/BodyPart.html">BodyPart</A></CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMultipart.html#getBodyPart(java.lang.String)">getBodyPart</A></B>(java.lang.String&nbsp;CID)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;int</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMultipart.html#getCount()">getCount</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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 &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMultipart.html#parse()">parse</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;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>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMultipart.html#setSubType(java.lang.String)">setSubType</A></B>(java.lang.String&nbsp;subtype)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the subtype.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>protected &nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMultipart.html#updateHeaders()">updateHeaders</A></B>()</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Update headers.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE>&nbsp;void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMultipart.html#writeTo(java.io.OutputStream)">writeTo</A></B>(java.io.OutputStream&nbsp;os)</CODE>

<BR>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Iterates through all the parts and outputs each Mime part
 separated by a boundary.</TD>
</TR>
</TABLE>
&nbsp;<A NAME="methods_inherited_from_class_javax.mail.Multipart"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from class javax.mail.<A HREF="../../../javax/mail/Multipart.html">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>
&nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from class java.lang.Object</B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
&nbsp;
<P>

<!-- ============ FIELD DETAIL =========== -->

<A NAME="field_detail"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<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>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?