mimemultipart.html

来自「SUN的JAVA MAIL API」· HTML 代码 · 共 495 行 · 第 1/2 页

HTML
495
字号
<TR BGCOLOR="white" ID="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" ID="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Field Detail</B></FONT></TD>
</TR>
</TABLE>

<A NAME="ds"><!-- --></A><H3>
ds</H3>
<PRE>
protected javax.activation.DataSource <B>ds</B></PRE>
<DL>
</DL>
<HR>

<A NAME="parsed"><!-- --></A><H3>
parsed</H3>
<PRE>
protected boolean <B>parsed</B></PRE>
<DL>
</DL>

<!-- ========= CONSTRUCTOR DETAIL ======== -->

<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" ID="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.</DL>
<HR>

<A NAME="MimeMultipart(java.lang.String)"><!-- --></A><H3>
MimeMultipart</H3>
<PRE>
public <B>MimeMultipart</B>(java.lang.String&nbsp;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.</DL>
<HR>

<A NAME="MimeMultipart(javax.activation.DataSource)"><!-- --></A><H3>
MimeMultipart</H3>
<PRE>
public <B>MimeMultipart</B>(javax.activation.DataSource&nbsp;ds)
              throws <A HREF="../../../javax/mail/MessagingException.html">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 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.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>ds</CODE> - DataSource, can be a MultipartDataSource</DL>
</DD>
</DL>

<!-- ============ METHOD DETAIL ========== -->

<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" ID="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>(java.lang.String&nbsp;subtype)
                throws <A HREF="../../../javax/mail/MessagingException.html">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><DD><DL>
<DT><B>Parameters:</B><DD><CODE>subtype</CODE> - Subtype</DL>
</DD>
</DL>
<HR>

<A NAME="getCount()"><!-- --></A><H3>
getCount</H3>
<PRE>
public int <B>getCount</B>()
             throws <A HREF="../../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>Return the number of enclosed BodyPart objects.<DD><DL>
<DT><B>Returns:</B><DD>number of parts<DT><B>Overrides:</B><DD><A HREF="../../../javax/mail/Multipart.html#getCount()">getCount</A> in class <A HREF="../../../javax/mail/Multipart.html">Multipart</A></DL>
</DD>
</DL>
<HR>

<A NAME="getBodyPart(int)"><!-- --></A><H3>
getBodyPart</H3>
<PRE>
public <A HREF="../../../javax/mail/BodyPart.html">BodyPart</A> <B>getBodyPart</B>(int&nbsp;index)
                     throws <A HREF="../../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>Get the specified BodyPart.  BodyParts are numbered starting at 0.<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><A HREF="../../../javax/mail/MessagingException.html">MessagingException</A> - if no such BodyPart exists<DT><B>Overrides:</B><DD><A HREF="../../../javax/mail/Multipart.html#getBodyPart(int)">getBodyPart</A> in class <A HREF="../../../javax/mail/Multipart.html">Multipart</A></DL>
</DD>
</DL>
<HR>

<A NAME="getBodyPart(java.lang.String)"><!-- --></A><H3>
getBodyPart</H3>
<PRE>
public <A HREF="../../../javax/mail/BodyPart.html">BodyPart</A> <B>getBodyPart</B>(java.lang.String&nbsp;CID)
                     throws <A HREF="../../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>Get the MimeBodyPart referred to by the given ContentID (CID). 
 Returns null if the part is not found.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>CID</CODE> - the ContentID of the desired part<DT><B>Returns:</B><DD>the Part</DL>
</DD>
</DL>
<HR>

<A NAME="updateHeaders()"><!-- --></A><H3>
updateHeaders</H3>
<PRE>
protected void <B>updateHeaders</B>()
                      throws <A HREF="../../../javax/mail/MessagingException.html">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.</DL>
<HR>

<A NAME="writeTo(java.io.OutputStream)"><!-- --></A><H3>
writeTo</H3>
<PRE>
public void <B>writeTo</B>(java.io.OutputStream&nbsp;os)
             throws java.io.IOException,
                    <A HREF="../../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>Iterates through all the parts and outputs each Mime part
 separated by a boundary.<DD><DL>
<DT><B>Overrides:</B><DD><A HREF="../../../javax/mail/Multipart.html#writeTo(java.io.OutputStream)">writeTo</A> in class <A HREF="../../../javax/mail/Multipart.html">Multipart</A></DL>
</DD>
</DL>
<!-- ========= END OF CLASS DATA ========= -->
<HR>

<!-- ========== START OF NAVBAR ========== -->
<A NAME="navbar_bottom"><!-- --></A>
<TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0">
<TR>
<TD COLSPAN=2 BGCOLOR="#EEEEFF" ID="NavBarCell1">
<A NAME="navbar_bottom_firstrow"><!-- --></A>
<TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3">
  <TR ALIGN="center" VALIGN="top">
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="../../../overview-summary.html"><FONT ID="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="package-summary.html"><FONT ID="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#FFFFFF" ID="NavBarCell1Rev"> &nbsp;<FONT ID="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="class-use/MimeMultipart.html"><FONT ID="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="package-tree.html"><FONT ID="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT ID="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="../../../index-files/index-1.html"><FONT ID="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  <TD BGCOLOR="#EEEEFF" ID="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT ID="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" ID="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" ID="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" ID="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" ID="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>

</BODY>
</HTML>

⌨️ 快捷键说明

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