Subversion Repositories javautils

Rev

Blame | Last modification | View Log | RSS feed

  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <!--NewPage-->
  3. <HTML>
  4. <HEAD>
  5. <!-- Generated by javadoc (build 1.6.0_10) on Tue Nov 17 12:13:40 PST 2009 -->
  6. <META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  7. <TITLE>
  8. MimeMultipart (JavaMail API documentation)
  9. </TITLE>
  10.  
  11. <META NAME="date" CONTENT="2009-11-17">
  12.  
  13. <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../stylesheet.css" TITLE="Style">
  14.  
  15. <SCRIPT type="text/javascript">
  16. function windowTitle()
  17. {
  18.     if (location.href.indexOf('is-external=true') == -1) {
  19.         parent.document.title="MimeMultipart (JavaMail API documentation)";
  20.     }
  21. }
  22. </SCRIPT>
  23. <NOSCRIPT>
  24. </NOSCRIPT>
  25.  
  26. </HEAD>
  27.  
  28. <BODY BGCOLOR="white" onload="windowTitle();">
  29. <HR>
  30.  
  31.  
  32. <!-- ========= START OF TOP NAVBAR ======= -->
  33. <A NAME="navbar_top"><!-- --></A>
  34. <A HREF="#skip-navbar_top" title="Skip navigation links"></A>
  35. <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
  36. <TR>
  37. <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
  38. <A NAME="navbar_top_firstrow"><!-- --></A>
  39. <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  40.   <TR ALIGN="center" VALIGN="top">
  41.   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  42.   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  43.   <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  44.   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/MimeMultipart.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  45.   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  46.   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  47.   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  48.   <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  49.   </TR>
  50. </TABLE>
  51. </TD>
  52. <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
  53. </EM>
  54. </TD>
  55. </TR>
  56.  
  57. <TR>
  58. <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  59. &nbsp;<A HREF="../../../javax/mail/internet/MimeMessage.RecipientType.html" title="class in javax.mail.internet"><B>PREV CLASS</B></A>&nbsp;
  60. &nbsp;<A HREF="../../../javax/mail/internet/MimePart.html" title="interface in javax.mail.internet"><B>NEXT CLASS</B></A></FONT></TD>
  61. <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  62.   <A HREF="../../../index.html?javax/mail/internet/MimeMultipart.html" target="_top"><B>FRAMES</B></A>  &nbsp;
  63. &nbsp;<A HREF="MimeMultipart.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
  64. &nbsp;<SCRIPT type="text/javascript">
  65.   <!--
  66.   if(window==top) {
  67.     document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
  68.   }
  69.   //-->
  70. </SCRIPT>
  71. <NOSCRIPT>
  72.   <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
  73. </NOSCRIPT>
  74.  
  75.  
  76. </FONT></TD>
  77. </TR>
  78. <TR>
  79. <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  80.   SUMMARY:&nbsp;NESTED&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>
  81. <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  82. 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>
  83. </TR>
  84. </TABLE>
  85. <A NAME="skip-navbar_top"></A>
  86. <!-- ========= END OF TOP NAVBAR ========= -->
  87.  
  88. <HR>
  89. <!-- ======== START OF CLASS DATA ======== -->
  90. <H2>
  91. <FONT SIZE="-1">
  92. javax.mail.internet</FONT>
  93. <BR>
  94. Class MimeMultipart</H2>
  95. <PRE>
  96. <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</A>
  97.   <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><A HREF="../../../javax/mail/Multipart.html" title="class in javax.mail">javax.mail.Multipart</A>
  98.       <IMG SRC="../../../resources/inherit.gif" ALT="extended by "><B>javax.mail.internet.MimeMultipart</B>
  99. </PRE>
  100. <DL>
  101. <DT><B>Direct Known Subclasses:</B> <DD><A HREF="../../../com/sun/mail/dsn/MultipartReport.html" title="class in com.sun.mail.dsn">MultipartReport</A></DD>
  102. </DL>
  103. <HR>
  104. <DL>
  105. <DT><PRE>public class <B>MimeMultipart</B><DT>extends <A HREF="../../../javax/mail/Multipart.html" title="class in javax.mail">Multipart</A></DL>
  106. </PRE>
  107.  
  108. <P>
  109. The MimeMultipart class is an implementation of the abstract Multipart
  110.  class that uses MIME conventions for the multipart data. <p>
  111.  
  112.  A MimeMultipart is obtained from a MimePart whose primary type
  113.  is "multipart" (by invoking the part's <code>getContent()</code> method)
  114. or it can be created by a client as part of creating a new MimeMessage. <p>
  115.  
  116. The default multipart subtype is "mixed".  The other multipart
  117. subtypes, such as "alternative", "related", and so on, can be
  118. implemented as subclasses of MimeMultipart with additional methods
  119. to implement the additional semantics of that type of multipart
  120. content. The intent is that service providers, mail JavaBean writers
  121. and mail clients will write many such subclasses and their Command
  122. Beans, and will install them into the JavaBeans Activation
  123. Framework, so that any JavaMail implementation and its clients can
  124. transparently find and use these classes. Thus, a MIME multipart
  125. handler is treated just like any other type handler, thereby
  126. decoupling the process of providing multipart handlers from the
  127. JavaMail API. Lacking these additional MimeMultipart subclasses,
  128. all subtypes of MIME multipart data appear as MimeMultipart objects. <p>
  129.  
  130. An application can directly construct a MIME multipart object of any
  131. subtype by using the <code>MimeMultipart(String subtype)</code>
  132. constructor.  For example, to create a "multipart/alternative" object,
  133. use <code>new MimeMultipart("alternative")</code>. <p>
  134.  
  135. The <code>mail.mime.multipart.ignoremissingendboundary</code>
  136. property may be set to <code>false</code> to cause a
  137. <code>MessagingException</code> to be thrown if the multipart
  138. data does not end with the required end boundary line.  If this
  139. property is set to <code>true</code> or not set, missing end
  140. boundaries are not considered an error and the final body part
  141. ends at the end of the data. <p>
  142.  
  143. The <code>mail.mime.multipart.ignoremissingboundaryparameter</code>
  144. System property may be set to <code>false</code> to cause a
  145. <code>MessagingException</code> to be thrown if the Content-Type
  146. of the MimeMultipart does not include a <code>boundary</code> parameter.
  147. If this property is set to <code>true</code> or not set, the multipart
  148. parsing code will look for a line that looks like a bounary line and
  149. use that as the boundary separating the parts. <p>
  150.  
  151. The current implementation also supports the following properties: <p>
  152.  
  153. The <code>mail.mime.multipart.ignoreexistingboundaryparameter</code>
  154. System property may be set to <code>true</code> to cause any boundary
  155. to be ignored and instead search for a boundary line in the message
  156. as with <code>mail.mime.multipart.ignoremissingboundaryparameter</code>. <p>
  157.  
  158. Normally, when writing out a MimeMultipart that contains no body
  159. parts, or when trying to parse a multipart message with no body parts,
  160. a <code>MessagingException</code> is thrown.  The MIME spec does not allow
  161. multipart content with no body parts.  The
  162. <code>mail.mime.multipart.allowempty</code> System property may be set to
  163. <code>true</code> to override this behavior.
  164. When writing out such a MimeMultipart, a single empty part will be
  165. included.  When reading such a multipart, a MimeMultipart will be created
  166. with no body parts.
  167. <P>
  168.  
  169. <P>
  170. <HR>
  171.  
  172. <P>
  173. <!-- =========== FIELD SUMMARY =========== -->
  174.  
  175. <A NAME="field_summary"><!-- --></A>
  176. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  177. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  178. <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
  179. <B>Field Summary</B></FONT></TH>
  180. </TR>
  181. <TR BGCOLOR="white" CLASS="TableRowColor">
  182. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  183. <CODE>protected &nbsp;<A HREF="http://java.sun.com/javase/technologies/desktop/javabeans/glasgow/javadocs/javax/activation/DataSource.html?is-external=true" title="class or interface in javax.activation">DataSource</A></CODE></FONT></TD>
  184. <TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMultipart.html#ds">ds</A></B></CODE>
  185.  
  186. <BR>
  187. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The DataSource supplying our InputStream.</TD>
  188. </TR>
  189. <TR BGCOLOR="white" CLASS="TableRowColor">
  190. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  191. <CODE>protected &nbsp;boolean</CODE></FONT></TD>
  192. <TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMultipart.html#parsed">parsed</A></B></CODE>
  193.  
  194. <BR>
  195. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Have we parsed the data from our InputStream yet?
  196. Defaults to true; set to false when our constructor is
  197. given a DataSource with an InputStream that we need to
  198. parse.</TD>
  199. </TR>
  200. </TABLE>
  201. &nbsp;<A NAME="fields_inherited_from_class_javax.mail.Multipart"><!-- --></A>
  202. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  203. <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
  204. <TH ALIGN="left"><B>Fields inherited from class javax.mail.<A HREF="../../../javax/mail/Multipart.html" title="class in javax.mail">Multipart</A></B></TH>
  205. </TR>
  206. <TR BGCOLOR="white" CLASS="TableRowColor">
  207. <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>
  208. </TR>
  209. </TABLE>
  210. &nbsp;
  211. <!-- ======== CONSTRUCTOR SUMMARY ======== -->
  212.  
  213. <A NAME="constructor_summary"><!-- --></A>
  214. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  215. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  216. <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
  217. <B>Constructor Summary</B></FONT></TH>
  218. </TR>
  219. <TR BGCOLOR="white" CLASS="TableRowColor">
  220. <TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMultipart.html#MimeMultipart()">MimeMultipart</A></B>()</CODE>
  221.  
  222. <BR>
  223. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Default constructor.</TD>
  224. </TR>
  225. <TR BGCOLOR="white" CLASS="TableRowColor">
  226. <TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMultipart.html#MimeMultipart(javax.activation.DataSource)">MimeMultipart</A></B>(<A HREF="http://java.sun.com/javase/technologies/desktop/javabeans/glasgow/javadocs/javax/activation/DataSource.html?is-external=true" title="class or interface in javax.activation">DataSource</A>&nbsp;ds)</CODE>
  227.  
  228. <BR>
  229. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Constructs a MimeMultipart object and its bodyparts from the
  230. given DataSource.</TD>
  231. </TR>
  232. <TR BGCOLOR="white" CLASS="TableRowColor">
  233. <TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMultipart.html#MimeMultipart(java.lang.String)">MimeMultipart</A></B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;subtype)</CODE>
  234.  
  235. <BR>
  236. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Construct a MimeMultipart object of the given subtype.</TD>
  237. </TR>
  238. </TABLE>
  239. &nbsp;
  240. <!-- ========== METHOD SUMMARY =========== -->
  241.  
  242. <A NAME="method_summary"><!-- --></A>
  243. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  244. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  245. <TH ALIGN="left" COLSPAN="2"><FONT SIZE="+2">
  246. <B>Method Summary</B></FONT></TH>
  247. </TR>
  248. <TR BGCOLOR="white" CLASS="TableRowColor">
  249. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  250. <CODE>&nbsp;void</CODE></FONT></TD>
  251. <TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMultipart.html#addBodyPart(javax.mail.BodyPart)">addBodyPart</A></B>(<A HREF="../../../javax/mail/BodyPart.html" title="class in javax.mail">BodyPart</A>&nbsp;part)</CODE>
  252.  
  253. <BR>
  254. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Adds a Part to the multipart.</TD>
  255. </TR>
  256. <TR BGCOLOR="white" CLASS="TableRowColor">
  257. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  258. <CODE>&nbsp;void</CODE></FONT></TD>
  259. <TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMultipart.html#addBodyPart(javax.mail.BodyPart, int)">addBodyPart</A></B>(<A HREF="../../../javax/mail/BodyPart.html" title="class in javax.mail">BodyPart</A>&nbsp;part,
  260.            int&nbsp;index)</CODE>
  261.  
  262. <BR>
  263. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Adds a BodyPart at position <code>index</code>.</TD>
  264. </TR>
  265. <TR BGCOLOR="white" CLASS="TableRowColor">
  266. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  267. <CODE>protected &nbsp;<A HREF="../../../javax/mail/internet/InternetHeaders.html" title="class in javax.mail.internet">InternetHeaders</A></CODE></FONT></TD>
  268. <TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMultipart.html#createInternetHeaders(java.io.InputStream)">createInternetHeaders</A></B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</A>&nbsp;is)</CODE>
  269.  
  270. <BR>
  271. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create and return an InternetHeaders object that loads the
  272. headers from the given InputStream.</TD>
  273. </TR>
  274. <TR BGCOLOR="white" CLASS="TableRowColor">
  275. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  276. <CODE>protected &nbsp;<A HREF="../../../javax/mail/internet/MimeBodyPart.html" title="class in javax.mail.internet">MimeBodyPart</A></CODE></FONT></TD>
  277. <TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMultipart.html#createMimeBodyPart(java.io.InputStream)">createMimeBodyPart</A></B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</A>&nbsp;is)</CODE>
  278.  
  279. <BR>
  280. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create and return a MimeBodyPart object to represent a
  281. body part parsed from the InputStream.</TD>
  282. </TR>
  283. <TR BGCOLOR="white" CLASS="TableRowColor">
  284. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  285. <CODE>protected &nbsp;<A HREF="../../../javax/mail/internet/MimeBodyPart.html" title="class in javax.mail.internet">MimeBodyPart</A></CODE></FONT></TD>
  286. <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" title="class in javax.mail.internet">InternetHeaders</A>&nbsp;headers,
  287.                   byte[]&nbsp;content)</CODE>
  288.  
  289. <BR>
  290. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Create and return a MimeBodyPart object to represent a
  291. body part parsed from the InputStream.</TD>
  292. </TR>
  293. <TR BGCOLOR="white" CLASS="TableRowColor">
  294. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  295. <CODE>&nbsp;<A HREF="../../../javax/mail/BodyPart.html" title="class in javax.mail">BodyPart</A></CODE></FONT></TD>
  296. <TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMultipart.html#getBodyPart(int)">getBodyPart</A></B>(int&nbsp;index)</CODE>
  297.  
  298. <BR>
  299. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the specified BodyPart.</TD>
  300. </TR>
  301. <TR BGCOLOR="white" CLASS="TableRowColor">
  302. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  303. <CODE>&nbsp;<A HREF="../../../javax/mail/BodyPart.html" title="class in javax.mail">BodyPart</A></CODE></FONT></TD>
  304. <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.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;CID)</CODE>
  305.  
  306. <BR>
  307. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the MimeBodyPart referred to by the given ContentID (CID).</TD>
  308. </TR>
  309. <TR BGCOLOR="white" CLASS="TableRowColor">
  310. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  311. <CODE>&nbsp;int</CODE></FONT></TD>
  312. <TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMultipart.html#getCount()">getCount</A></B>()</CODE>
  313.  
  314. <BR>
  315. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return the number of enclosed BodyPart objects.</TD>
  316. </TR>
  317. <TR BGCOLOR="white" CLASS="TableRowColor">
  318. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  319. <CODE>&nbsp;<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A></CODE></FONT></TD>
  320. <TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMultipart.html#getPreamble()">getPreamble</A></B>()</CODE>
  321.  
  322. <BR>
  323. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Get the preamble text, if any, that appears before the
  324. first body part of this multipart.</TD>
  325. </TR>
  326. <TR BGCOLOR="white" CLASS="TableRowColor">
  327. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  328. <CODE>&nbsp;boolean</CODE></FONT></TD>
  329. <TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMultipart.html#isComplete()">isComplete</A></B>()</CODE>
  330.  
  331. <BR>
  332. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Return true if the final boundary line for this
  333. multipart was seen.</TD>
  334. </TR>
  335. <TR BGCOLOR="white" CLASS="TableRowColor">
  336. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  337. <CODE>protected &nbsp;void</CODE></FONT></TD>
  338. <TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMultipart.html#parse()">parse</A></B>()</CODE>
  339.  
  340. <BR>
  341. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Parse the InputStream from our DataSource, constructing the
  342. appropriate MimeBodyParts.</TD>
  343. </TR>
  344. <TR BGCOLOR="white" CLASS="TableRowColor">
  345. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  346. <CODE>&nbsp;boolean</CODE></FONT></TD>
  347. <TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMultipart.html#removeBodyPart(javax.mail.BodyPart)">removeBodyPart</A></B>(<A HREF="../../../javax/mail/BodyPart.html" title="class in javax.mail">BodyPart</A>&nbsp;part)</CODE>
  348.  
  349. <BR>
  350. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Remove the specified part from the multipart message.</TD>
  351. </TR>
  352. <TR BGCOLOR="white" CLASS="TableRowColor">
  353. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  354. <CODE>&nbsp;void</CODE></FONT></TD>
  355. <TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMultipart.html#removeBodyPart(int)">removeBodyPart</A></B>(int&nbsp;index)</CODE>
  356.  
  357. <BR>
  358. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Remove the part at specified location (starting from 0).</TD>
  359. </TR>
  360. <TR BGCOLOR="white" CLASS="TableRowColor">
  361. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  362. <CODE>&nbsp;void</CODE></FONT></TD>
  363. <TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMultipart.html#setPreamble(java.lang.String)">setPreamble</A></B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;preamble)</CODE>
  364.  
  365. <BR>
  366. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the preamble text to be included before the first
  367. body part.</TD>
  368. </TR>
  369. <TR BGCOLOR="white" CLASS="TableRowColor">
  370. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  371. <CODE>&nbsp;void</CODE></FONT></TD>
  372. <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.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;subtype)</CODE>
  373.  
  374. <BR>
  375. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Set the subtype.</TD>
  376. </TR>
  377. <TR BGCOLOR="white" CLASS="TableRowColor">
  378. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  379. <CODE>protected &nbsp;void</CODE></FONT></TD>
  380. <TD><CODE><B><A HREF="../../../javax/mail/internet/MimeMultipart.html#updateHeaders()">updateHeaders</A></B>()</CODE>
  381.  
  382. <BR>
  383. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Update headers.</TD>
  384. </TR>
  385. <TR BGCOLOR="white" CLASS="TableRowColor">
  386. <TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
  387. <CODE>&nbsp;void</CODE></FONT></TD>
  388. <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.2/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</A>&nbsp;os)</CODE>
  389.  
  390. <BR>
  391. &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Iterates through all the parts and outputs each MIME part
  392. separated by a boundary.</TD>
  393. </TR>
  394. </TABLE>
  395. &nbsp;<A NAME="methods_inherited_from_class_javax.mail.Multipart"><!-- --></A>
  396. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  397. <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
  398. <TH ALIGN="left"><B>Methods inherited from class javax.mail.<A HREF="../../../javax/mail/Multipart.html" title="class in javax.mail">Multipart</A></B></TH>
  399. </TR>
  400. <TR BGCOLOR="white" CLASS="TableRowColor">
  401. <TD><CODE><A HREF="../../../javax/mail/Multipart.html#getContentType()">getContentType</A>, <A HREF="../../../javax/mail/Multipart.html#getParent()">getParent</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>
  402. </TR>
  403. </TABLE>
  404. &nbsp;<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
  405. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  406. <TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
  407. <TH ALIGN="left"><B>Methods inherited from class java.lang.<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A></B></TH>
  408. </TR>
  409. <TR BGCOLOR="white" CLASS="TableRowColor">
  410. <TD><CODE><A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</A>, <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true#wait(long, int)" title="class or interface in java.lang">wait</A></CODE></TD>
  411. </TR>
  412. </TABLE>
  413. &nbsp;
  414. <P>
  415.  
  416. <!-- ============ FIELD DETAIL =========== -->
  417.  
  418. <A NAME="field_detail"><!-- --></A>
  419. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  420. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  421. <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
  422. <B>Field Detail</B></FONT></TH>
  423. </TR>
  424. </TABLE>
  425.  
  426. <A NAME="ds"><!-- --></A><H3>
  427. ds</H3>
  428. <PRE>
  429. protected <A HREF="http://java.sun.com/javase/technologies/desktop/javabeans/glasgow/javadocs/javax/activation/DataSource.html?is-external=true" title="class or interface in javax.activation">DataSource</A> <B>ds</B></PRE>
  430. <DL>
  431. <DD>The DataSource supplying our InputStream.
  432. <P>
  433. <DL>
  434. </DL>
  435. </DL>
  436. <HR>
  437.  
  438. <A NAME="parsed"><!-- --></A><H3>
  439. parsed</H3>
  440. <PRE>
  441. protected boolean <B>parsed</B></PRE>
  442. <DL>
  443. <DD>Have we parsed the data from our InputStream yet?
  444. Defaults to true; set to false when our constructor is
  445. given a DataSource with an InputStream that we need to
  446. parse.
  447. <P>
  448. <DL>
  449. </DL>
  450. </DL>
  451.  
  452. <!-- ========= CONSTRUCTOR DETAIL ======== -->
  453.  
  454. <A NAME="constructor_detail"><!-- --></A>
  455. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  456. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  457. <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
  458. <B>Constructor Detail</B></FONT></TH>
  459. </TR>
  460. </TABLE>
  461.  
  462. <A NAME="MimeMultipart()"><!-- --></A><H3>
  463. MimeMultipart</H3>
  464. <PRE>
  465. public <B>MimeMultipart</B>()</PRE>
  466. <DL>
  467. <DD>Default constructor. An empty MimeMultipart object
  468. is created. Its content type is set to "multipart/mixed".
  469. A unique boundary string is generated and this string is
  470. setup as the "boundary" parameter for the
  471. <code>contentType</code> field. <p>
  472.  
  473. MimeBodyParts may be added later.
  474. <P>
  475. </DL>
  476. <HR>
  477.  
  478. <A NAME="MimeMultipart(java.lang.String)"><!-- --></A><H3>
  479. MimeMultipart</H3>
  480. <PRE>
  481. public <B>MimeMultipart</B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;subtype)</PRE>
  482. <DL>
  483. <DD>Construct a MimeMultipart object of the given subtype.
  484. A unique boundary string is generated and this string is
  485. setup as the "boundary" parameter for the
  486. <code>contentType</code> field. <p>
  487.  
  488. MimeBodyParts may be added later.
  489. <P>
  490. </DL>
  491. <HR>
  492.  
  493. <A NAME="MimeMultipart(javax.activation.DataSource)"><!-- --></A><H3>
  494. MimeMultipart</H3>
  495. <PRE>
  496. public <B>MimeMultipart</B>(<A HREF="http://java.sun.com/javase/technologies/desktop/javabeans/glasgow/javadocs/javax/activation/DataSource.html?is-external=true" title="class or interface in javax.activation">DataSource</A>&nbsp;ds)
  497.              throws <A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></PRE>
  498. <DL>
  499. <DD>Constructs a MimeMultipart object and its bodyparts from the
  500. given DataSource. <p>
  501.  
  502. This constructor handles as a special case the situation where the
  503. given DataSource is a MultipartDataSource object.  In this case, this
  504. method just invokes the superclass (i.e., Multipart) constructor
  505. that takes a MultipartDataSource object. <p>
  506.  
  507. Otherwise, the DataSource is assumed to provide a MIME multipart
  508. byte stream.  The <code>parsed</code> flag is set to false.  When
  509. the data for the body parts are needed, the parser extracts the
  510. "boundary" parameter from the content type of this DataSource,
  511. skips the 'preamble' and reads bytes till the terminating
  512. boundary and creates MimeBodyParts for each part of the stream.
  513. <P>
  514. <DL>
  515. <DT><B>Parameters:</B><DD><CODE>ds</CODE> - DataSource, can be a MultipartDataSource
  516. <DT><B>Throws:</B>
  517. <DD><CODE><A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></CODE></DL>
  518. </DL>
  519.  
  520. <!-- ============ METHOD DETAIL ========== -->
  521.  
  522. <A NAME="method_detail"><!-- --></A>
  523. <TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
  524. <TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
  525. <TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
  526. <B>Method Detail</B></FONT></TH>
  527. </TR>
  528. </TABLE>
  529.  
  530. <A NAME="setSubType(java.lang.String)"><!-- --></A><H3>
  531. setSubType</H3>
  532. <PRE>
  533. public void <B>setSubType</B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;subtype)
  534.                throws <A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></PRE>
  535. <DL>
  536. <DD>Set the subtype. This method should be invoked only on a new
  537. MimeMultipart object created by the client. The default subtype
  538. of such a multipart object is "mixed". <p>
  539. <P>
  540. <DD><DL>
  541. <DT><B>Parameters:</B><DD><CODE>subtype</CODE> - Subtype
  542. <DT><B>Throws:</B>
  543. <DD><CODE><A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></CODE></DL>
  544. </DD>
  545. </DL>
  546. <HR>
  547.  
  548. <A NAME="getCount()"><!-- --></A><H3>
  549. getCount</H3>
  550. <PRE>
  551. public int <B>getCount</B>()
  552.             throws <A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></PRE>
  553. <DL>
  554. <DD>Return the number of enclosed BodyPart objects.
  555. <P>
  556. <DD><DL>
  557. <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>
  558. </DD>
  559. <DD><DL>
  560.  
  561. <DT><B>Returns:</B><DD>number of parts
  562. <DT><B>Throws:</B>
  563. <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>
  564. </DD>
  565. </DL>
  566. <HR>
  567.  
  568. <A NAME="getBodyPart(int)"><!-- --></A><H3>
  569. getBodyPart</H3>
  570. <PRE>
  571. public <A HREF="../../../javax/mail/BodyPart.html" title="class in javax.mail">BodyPart</A> <B>getBodyPart</B>(int&nbsp;index)
  572.                     throws <A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></PRE>
  573. <DL>
  574. <DD>Get the specified BodyPart.  BodyParts are numbered starting at 0.
  575. <P>
  576. <DD><DL>
  577. <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>
  578. </DD>
  579. <DD><DL>
  580. <DT><B>Parameters:</B><DD><CODE>index</CODE> - the index of the desired BodyPart
  581. <DT><B>Returns:</B><DD>the Part
  582. <DT><B>Throws:</B>
  583. <DD><CODE><A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></CODE> - if no such BodyPart exists</DL>
  584. </DD>
  585. </DL>
  586. <HR>
  587.  
  588. <A NAME="getBodyPart(java.lang.String)"><!-- --></A><H3>
  589. getBodyPart</H3>
  590. <PRE>
  591. 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.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;CID)
  592.                     throws <A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></PRE>
  593. <DL>
  594. <DD>Get the MimeBodyPart referred to by the given ContentID (CID).
  595. Returns null if the part is not found.
  596. <P>
  597. <DD><DL>
  598. <DT><B>Parameters:</B><DD><CODE>CID</CODE> - the ContentID of the desired part
  599. <DT><B>Returns:</B><DD>the Part
  600. <DT><B>Throws:</B>
  601. <DD><CODE><A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></CODE></DL>
  602. </DD>
  603. </DL>
  604. <HR>
  605.  
  606. <A NAME="removeBodyPart(javax.mail.BodyPart)"><!-- --></A><H3>
  607. removeBodyPart</H3>
  608. <PRE>
  609. public boolean <B>removeBodyPart</B>(<A HREF="../../../javax/mail/BodyPart.html" title="class in javax.mail">BodyPart</A>&nbsp;part)
  610.                       throws <A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></PRE>
  611. <DL>
  612. <DD>Remove the specified part from the multipart message.
  613. Shifts all the parts after the removed part down one.
  614. <P>
  615. <DD><DL>
  616. <DT><B>Overrides:</B><DD><CODE><A HREF="../../../javax/mail/Multipart.html#removeBodyPart(javax.mail.BodyPart)">removeBodyPart</A></CODE> in class <CODE><A HREF="../../../javax/mail/Multipart.html" title="class in javax.mail">Multipart</A></CODE></DL>
  617. </DD>
  618. <DD><DL>
  619. <DT><B>Parameters:</B><DD><CODE>part</CODE> - The part to remove
  620. <DT><B>Returns:</B><DD>true if part removed, false otherwise
  621. <DT><B>Throws:</B>
  622. <DD><CODE><A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></CODE> - if no such Part exists
  623. <DD><CODE><A HREF="../../../javax/mail/IllegalWriteException.html" title="class in javax.mail">IllegalWriteException</A></CODE> - if the underlying
  624.                        implementation does not support modification
  625.                        of existing values</DL>
  626. </DD>
  627. </DL>
  628. <HR>
  629.  
  630. <A NAME="removeBodyPart(int)"><!-- --></A><H3>
  631. removeBodyPart</H3>
  632. <PRE>
  633. public void <B>removeBodyPart</B>(int&nbsp;index)
  634.                    throws <A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></PRE>
  635. <DL>
  636. <DD>Remove the part at specified location (starting from 0).
  637. Shifts all the parts after the removed part down one.
  638. <P>
  639. <DD><DL>
  640. <DT><B>Overrides:</B><DD><CODE><A HREF="../../../javax/mail/Multipart.html#removeBodyPart(int)">removeBodyPart</A></CODE> in class <CODE><A HREF="../../../javax/mail/Multipart.html" title="class in javax.mail">Multipart</A></CODE></DL>
  641. </DD>
  642. <DD><DL>
  643. <DT><B>Parameters:</B><DD><CODE>index</CODE> - Index of the part to remove
  644. <DT><B>Throws:</B>
  645. <DD><CODE><A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></CODE>
  646. <DD><CODE><A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/IndexOutOfBoundsException.html?is-external=true" title="class or interface in java.lang">IndexOutOfBoundsException</A></CODE> - if the given index
  647.                        is out of range.
  648. <DD><CODE><A HREF="../../../javax/mail/IllegalWriteException.html" title="class in javax.mail">IllegalWriteException</A></CODE> - if the underlying
  649.                        implementation does not support modification
  650.                        of existing values</DL>
  651. </DD>
  652. </DL>
  653. <HR>
  654.  
  655. <A NAME="addBodyPart(javax.mail.BodyPart)"><!-- --></A><H3>
  656. addBodyPart</H3>
  657. <PRE>
  658. public void <B>addBodyPart</B>(<A HREF="../../../javax/mail/BodyPart.html" title="class in javax.mail">BodyPart</A>&nbsp;part)
  659.                 throws <A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></PRE>
  660. <DL>
  661. <DD>Adds a Part to the multipart.  The BodyPart is appended to
  662. the list of existing Parts.
  663. <P>
  664. <DD><DL>
  665. <DT><B>Overrides:</B><DD><CODE><A HREF="../../../javax/mail/Multipart.html#addBodyPart(javax.mail.BodyPart)">addBodyPart</A></CODE> in class <CODE><A HREF="../../../javax/mail/Multipart.html" title="class in javax.mail">Multipart</A></CODE></DL>
  666. </DD>
  667. <DD><DL>
  668. <DT><B>Parameters:</B><DD><CODE>part</CODE> - The Part to be appended
  669. <DT><B>Throws:</B>
  670. <DD><CODE><A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></CODE>
  671. <DD><CODE><A HREF="../../../javax/mail/IllegalWriteException.html" title="class in javax.mail">IllegalWriteException</A></CODE> - if the underlying
  672.                        implementation does not support modification
  673.                        of existing values</DL>
  674. </DD>
  675. </DL>
  676. <HR>
  677.  
  678. <A NAME="addBodyPart(javax.mail.BodyPart, int)"><!-- --></A><H3>
  679. addBodyPart</H3>
  680. <PRE>
  681. public void <B>addBodyPart</B>(<A HREF="../../../javax/mail/BodyPart.html" title="class in javax.mail">BodyPart</A>&nbsp;part,
  682.                        int&nbsp;index)
  683.                 throws <A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></PRE>
  684. <DL>
  685. <DD>Adds a BodyPart at position <code>index</code>.
  686. If <code>index</code> is not the last one in the list,
  687. the subsequent parts are shifted up. If <code>index</code>
  688. is larger than the number of parts present, the
  689. BodyPart is appended to the end.
  690. <P>
  691. <DD><DL>
  692. <DT><B>Overrides:</B><DD><CODE><A HREF="../../../javax/mail/Multipart.html#addBodyPart(javax.mail.BodyPart, int)">addBodyPart</A></CODE> in class <CODE><A HREF="../../../javax/mail/Multipart.html" title="class in javax.mail">Multipart</A></CODE></DL>
  693. </DD>
  694. <DD><DL>
  695. <DT><B>Parameters:</B><DD><CODE>part</CODE> - The BodyPart to be inserted<DD><CODE>index</CODE> - Location where to insert the part
  696. <DT><B>Throws:</B>
  697. <DD><CODE><A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></CODE>
  698. <DD><CODE><A HREF="../../../javax/mail/IllegalWriteException.html" title="class in javax.mail">IllegalWriteException</A></CODE> - if the underlying
  699.                        implementation does not support modification
  700.                        of existing values</DL>
  701. </DD>
  702. </DL>
  703. <HR>
  704.  
  705. <A NAME="isComplete()"><!-- --></A><H3>
  706. isComplete</H3>
  707. <PRE>
  708. public boolean <B>isComplete</B>()
  709.                   throws <A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></PRE>
  710. <DL>
  711. <DD>Return true if the final boundary line for this
  712. multipart was seen.  When parsing multipart content,
  713. this class will (by default) terminate parsing with
  714. no error if the end of input is reached before seeing
  715. the final multipart boundary line.  In such a case,
  716. this method will return false.  (If the System property
  717. "mail.mime.multipart.ignoremissingendboundary" is set to
  718. false, parsing such a message will instead throw a
  719. MessagingException.)
  720. <P>
  721. <DD><DL>
  722.  
  723. <DT><B>Returns:</B><DD>true if the final boundary line was seen
  724. <DT><B>Throws:</B>
  725. <DD><CODE><A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></CODE><DT><B>Since:</B></DT>
  726.  <DD>JavaMail 1.4</DD>
  727. </DL>
  728. </DD>
  729. </DL>
  730. <HR>
  731.  
  732. <A NAME="getPreamble()"><!-- --></A><H3>
  733. getPreamble</H3>
  734. <PRE>
  735. public <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>getPreamble</B>()
  736.                   throws <A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></PRE>
  737. <DL>
  738. <DD>Get the preamble text, if any, that appears before the
  739. first body part of this multipart.  Some protocols,
  740. such as IMAP, will not allow access to the preamble text.
  741. <P>
  742. <DD><DL>
  743.  
  744. <DT><B>Returns:</B><DD>the preamble text, or null if no preamble
  745. <DT><B>Throws:</B>
  746. <DD><CODE><A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></CODE><DT><B>Since:</B></DT>
  747.  <DD>JavaMail 1.4</DD>
  748. </DL>
  749. </DD>
  750. </DL>
  751. <HR>
  752.  
  753. <A NAME="setPreamble(java.lang.String)"><!-- --></A><H3>
  754. setPreamble</H3>
  755. <PRE>
  756. public void <B>setPreamble</B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A>&nbsp;preamble)
  757.                 throws <A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></PRE>
  758. <DL>
  759. <DD>Set the preamble text to be included before the first
  760. body part.  Applications should generally not include
  761. any preamble text.  In some cases it may be helpful to
  762. include preamble text with instructions for users of
  763. pre-MIME software.  The preamble text should be complete
  764. lines, including newlines.
  765. <P>
  766. <DD><DL>
  767. <DT><B>Parameters:</B><DD><CODE>preamble</CODE> - the preamble text
  768. <DT><B>Throws:</B>
  769. <DD><CODE><A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></CODE><DT><B>Since:</B></DT>
  770.  <DD>JavaMail 1.4</DD>
  771. </DL>
  772. </DD>
  773. </DL>
  774. <HR>
  775.  
  776. <A NAME="updateHeaders()"><!-- --></A><H3>
  777. updateHeaders</H3>
  778. <PRE>
  779. protected void <B>updateHeaders</B>()
  780.                      throws <A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></PRE>
  781. <DL>
  782. <DD>Update headers. The default implementation here just
  783. calls the <code>updateHeaders</code> method on each of its
  784. children BodyParts. <p>
  785.  
  786. Note that the boundary parameter is already set up when
  787. a new and empty MimeMultipart object is created. <p>
  788.  
  789. This method is called when the <code>saveChanges</code>
  790. method is invoked on the Message object containing this
  791. Multipart. This is typically done as part of the Message
  792. send process, however note that a client is free to call
  793. it any number of times. So if the header updating process is
  794. expensive for a specific MimeMultipart subclass, then it
  795. might itself want to track whether its internal state actually
  796. did change, and do the header updating only if necessary.
  797. <P>
  798. <DD><DL>
  799.  
  800. <DT><B>Throws:</B>
  801. <DD><CODE><A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></CODE></DL>
  802. </DD>
  803. </DL>
  804. <HR>
  805.  
  806. <A NAME="writeTo(java.io.OutputStream)"><!-- --></A><H3>
  807. writeTo</H3>
  808. <PRE>
  809. public void <B>writeTo</B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</A>&nbsp;os)
  810.             throws <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A>,
  811.                    <A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></PRE>
  812. <DL>
  813. <DD>Iterates through all the parts and outputs each MIME part
  814. separated by a boundary.
  815. <P>
  816. <DD><DL>
  817. <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>
  818. </DD>
  819. <DD><DL>
  820.  
  821. <DT><B>Throws:</B>
  822. <DD><CODE><A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></CODE> - if an IO related exception occurs
  823. <DD><CODE><A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></CODE></DL>
  824. </DD>
  825. </DL>
  826. <HR>
  827.  
  828. <A NAME="parse()"><!-- --></A><H3>
  829. parse</H3>
  830. <PRE>
  831. protected void <B>parse</B>()
  832.              throws <A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></PRE>
  833. <DL>
  834. <DD>Parse the InputStream from our DataSource, constructing the
  835. appropriate MimeBodyParts.  The <code>parsed</code> flag is
  836. set to true, and if true on entry nothing is done.  This
  837. method is called by all other methods that need data for
  838. the body parts, to make sure the data has been parsed.
  839. <P>
  840. <DD><DL>
  841.  
  842. <DT><B>Throws:</B>
  843. <DD><CODE><A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></CODE><DT><B>Since:</B></DT>
  844.  <DD>JavaMail 1.2</DD>
  845. </DL>
  846. </DD>
  847. </DL>
  848. <HR>
  849.  
  850. <A NAME="createInternetHeaders(java.io.InputStream)"><!-- --></A><H3>
  851. createInternetHeaders</H3>
  852. <PRE>
  853. 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.2/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</A>&nbsp;is)
  854.                                         throws <A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></PRE>
  855. <DL>
  856. <DD>Create and return an InternetHeaders object that loads the
  857. headers from the given InputStream.  Subclasses can override
  858. this method to return a subclass of InternetHeaders, if
  859. necessary.  This implementation simply constructs and returns
  860. an InternetHeaders object.
  861. <P>
  862. <DD><DL>
  863. <DT><B>Parameters:</B><DD><CODE>is</CODE> - the InputStream to read the headers from
  864. <DT><B>Throws:</B>
  865. <DD><CODE><A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></CODE><DT><B>Since:</B></DT>
  866.  <DD>JavaMail 1.2</DD>
  867. </DL>
  868. </DD>
  869. </DL>
  870. <HR>
  871.  
  872. <A NAME="createMimeBodyPart(javax.mail.internet.InternetHeaders, byte[])"><!-- --></A><H3>
  873. createMimeBodyPart</H3>
  874. <PRE>
  875. 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>&nbsp;headers,
  876.                                          byte[]&nbsp;content)
  877.                                   throws <A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></PRE>
  878. <DL>
  879. <DD>Create and return a MimeBodyPart object to represent a
  880. body part parsed from the InputStream.  Subclasses can override
  881. this method to return a subclass of MimeBodyPart, if
  882. necessary.  This implementation simply constructs and returns
  883. a MimeBodyPart object.
  884. <P>
  885. <DD><DL>
  886. <DT><B>Parameters:</B><DD><CODE>headers</CODE> - the headers for the body part<DD><CODE>content</CODE> - the content of the body part
  887. <DT><B>Throws:</B>
  888. <DD><CODE><A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></CODE><DT><B>Since:</B></DT>
  889.  <DD>JavaMail 1.2</DD>
  890. </DL>
  891. </DD>
  892. </DL>
  893. <HR>
  894.  
  895. <A NAME="createMimeBodyPart(java.io.InputStream)"><!-- --></A><H3>
  896. createMimeBodyPart</H3>
  897. <PRE>
  898. 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.2/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</A>&nbsp;is)
  899.                                   throws <A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></PRE>
  900. <DL>
  901. <DD>Create and return a MimeBodyPart object to represent a
  902. body part parsed from the InputStream.  Subclasses can override
  903. this method to return a subclass of MimeBodyPart, if
  904. necessary.  This implementation simply constructs and returns
  905. a MimeBodyPart object.
  906. <P>
  907. <DD><DL>
  908. <DT><B>Parameters:</B><DD><CODE>is</CODE> - InputStream containing the body part
  909. <DT><B>Throws:</B>
  910. <DD><CODE><A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></CODE><DT><B>Since:</B></DT>
  911.  <DD>JavaMail 1.2</DD>
  912. </DL>
  913. </DD>
  914. </DL>
  915. <!-- ========= END OF CLASS DATA ========= -->
  916. <HR>
  917.  
  918.  
  919. <!-- ======= START OF BOTTOM NAVBAR ====== -->
  920. <A NAME="navbar_bottom"><!-- --></A>
  921. <A HREF="#skip-navbar_bottom" title="Skip navigation links"></A>
  922. <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
  923. <TR>
  924. <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
  925. <A NAME="navbar_bottom_firstrow"><!-- --></A>
  926. <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
  927.  <TR ALIGN="center" VALIGN="top">
  928.  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A>&nbsp;</TD>
  929.  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A>&nbsp;</TD>
  930.  <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> &nbsp;<FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT>&nbsp;</TD>
  931.  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="class-use/MimeMultipart.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A>&nbsp;</TD>
  932.  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A>&nbsp;</TD>
  933.  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A>&nbsp;</TD>
  934.  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A>&nbsp;</TD>
  935.  <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1">    <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A>&nbsp;</TD>
  936.  </TR>
  937. </TABLE>
  938. </TD>
  939. <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM>
  940. </EM>
  941. </TD>
  942. </TR>
  943.  
  944. <TR>
  945. <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  946. &nbsp;<A HREF="../../../javax/mail/internet/MimeMessage.RecipientType.html" title="class in javax.mail.internet"><B>PREV CLASS</B></A>&nbsp;
  947. &nbsp;<A HREF="../../../javax/mail/internet/MimePart.html" title="interface in javax.mail.internet"><B>NEXT CLASS</B></A></FONT></TD>
  948. <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  949.  <A HREF="../../../index.html?javax/mail/internet/MimeMultipart.html" target="_top"><B>FRAMES</B></A>  &nbsp;
  950. &nbsp;<A HREF="MimeMultipart.html" target="_top"><B>NO FRAMES</B></A>  &nbsp;
  951. &nbsp;<SCRIPT type="text/javascript">
  952.  <!--
  953.  if(window==top) {
  954.    document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>');
  955.  }
  956.  //-->
  957. </SCRIPT>
  958. <NOSCRIPT>
  959.  <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>
  960. </NOSCRIPT>
  961.  
  962.  
  963. </FONT></TD>
  964. </TR>
  965. <TR>
  966. <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  967.  SUMMARY:&nbsp;NESTED&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>
  968. <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">
  969. 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>
  970. </TR>
  971. </TABLE>
  972. <A NAME="skip-navbar_bottom"></A>
  973. <!-- ======== END OF BOTTOM NAVBAR ======= -->
  974.  
  975. <HR>
  976. Copyright &#169; 2009 <a href="http://www.sun.com">Sun Microsystems, Inc.</a>. All Rights Reserved.
  977. </BODY>
  978. </HTML>
  979.