<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!-- NewPage --> <html lang="en"> <head> <!-- Generated by javadoc --> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>MimeBodyPart (JavaMail API documentation)</title> <link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style"> <script type="text/javascript" src="../../../script.js"></script> </head> <body> <script type="text/javascript"><!-- try { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="MimeBodyPart (JavaMail API documentation)"; } } catch(err) { } //--> var methods = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":10,"i11":10,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10,"i21":10,"i22":10,"i23":10,"i24":10,"i25":10,"i26":10,"i27":10,"i28":10,"i29":10,"i30":10,"i31":10,"i32":10,"i33":10,"i34":10,"i35":10,"i36":10,"i37":10,"i38":10,"i39":10,"i40":10,"i41":10,"i42":10,"i43":10,"i44":10,"i45":10,"i46":10,"i47":10,"i48":10}; var tabs = {65535:["t0","All Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"]}; var altColor = "altColor"; var rowColor = "rowColor"; var tableTab = "tableTab"; var activeTableTab = "activeTableTab"; </script> <noscript> <div>JavaScript is disabled on your browser.</div> </noscript> <!-- ========= START OF TOP NAVBAR ======= --> <div class="topNav"><a name="navbar.top"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.top.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/MimeBodyPart.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../index-files/index-1.html">Index</a></li> <li><a href="../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../javax/mail/internet/MailDateFormat.html" title="class in javax.mail.internet"><span class="typeNameLink">Prev Class</span></a></li> <li><a href="../../../javax/mail/internet/MimeMessage.html" title="class in javax.mail.internet"><span class="typeNameLink">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../index.html?javax/mail/internet/MimeBodyPart.html" target="_top">Frames</a></li> <li><a href="MimeBodyPart.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_top"> <li><a href="../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_top"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary: </li> <li>Nested | </li> <li><a href="#field.summary">Field</a> | </li> <li><a href="#constructor.summary">Constr</a> | </li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail: </li> <li><a href="#field.detail">Field</a> | </li> <li><a href="#constructor.detail">Constr</a> | </li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.top"> <!-- --> </a></div> <!-- ========= END OF TOP NAVBAR ========= --> <!-- ======== START OF CLASS DATA ======== --> <div class="header"> <div class="subTitle">javax.mail.internet</div> <h2 title="Class MimeBodyPart" class="title">Class MimeBodyPart</h2> </div> <div class="contentContainer"> <ul class="inheritance"> <li><a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li> <li> <ul class="inheritance"> <li><a href="../../../javax/mail/BodyPart.html" title="class in javax.mail">javax.mail.BodyPart</a></li> <li> <ul class="inheritance"> <li>javax.mail.internet.MimeBodyPart</li> </ul> </li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <dl> <dt>All Implemented Interfaces:</dt> <dd><a href="../../../javax/mail/internet/MimePart.html" title="interface in javax.mail.internet">MimePart</a>, <a href="../../../javax/mail/Part.html" title="interface in javax.mail">Part</a></dd> </dl> <dl> <dt>Direct Known Subclasses:</dt> <dd><a href="../../../javax/mail/internet/PreencodedMimeBodyPart.html" title="class in javax.mail.internet">PreencodedMimeBodyPart</a></dd> </dl> <hr> <br> <pre>public class <span class="typeNameLabel">MimeBodyPart</span> extends <a href="../../../javax/mail/BodyPart.html" title="class in javax.mail">BodyPart</a> implements <a href="../../../javax/mail/internet/MimePart.html" title="interface in javax.mail.internet">MimePart</a></pre> <div class="block">This class represents a MIME body part. It implements the <code>BodyPart</code> abstract class and the <code>MimePart</code> interface. MimeBodyParts are contained in <code>MimeMultipart</code> objects. <p> MimeBodyPart uses the <code>InternetHeaders</code> class to parse and store the headers of that body part. <hr><strong>A note on RFC 822 and MIME headers</strong><p> RFC 822 header fields <strong>must</strong> contain only US-ASCII characters. MIME allows non ASCII characters to be present in certain portions of certain headers, by encoding those characters. RFC 2047 specifies the rules for doing this. The MimeUtility class provided in this package can be used to to achieve this. Callers of the <code>setHeader</code>, <code>addHeader</code>, and <code>addHeaderLine</code> methods are responsible for enforcing the MIME requirements for the specified headers. In addition, these header fields must be folded (wrapped) before being sent if they exceed the line length limitation for the transport (1000 bytes for SMTP). Received headers may have been folded. The application is responsible for folding and unfolding headers as appropriate. <p></div> <dl> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javax/mail/Part.html" title="interface in javax.mail"><code>Part</code></a>, <a href="../../../javax/mail/internet/MimePart.html" title="interface in javax.mail.internet"><code>MimePart</code></a>, <a href="../../../javax/mail/internet/MimeUtility.html" title="class in javax.mail.internet"><code>MimeUtility</code></a></dd> </dl> </li> </ul> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- =========== FIELD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="field.summary"> <!-- --> </a> <h3>Field Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Field Summary table, listing fields, and an explanation"> <caption><span>Fields</span><span class="tabEnd"> </span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Field and Description</th> </tr> <tr class="altColor"> <td class="colFirst"><code>protected <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#cachedContent">cachedContent</a></span></code> <div class="block">If our content is a Multipart of Message object, we save it the first time it's created by parsing a stream so that changes to the contained objects will not be lost.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>protected byte[]</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#content">content</a></span></code> <div class="block">Byte array that holds the bytes of the content of this Part.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>protected <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#contentStream">contentStream</a></span></code> <div class="block">If the data for this body part was supplied by an InputStream that implements the SharedInputStream interface, <code>contentStream</code> is another such stream representing the content of this body part.</div> </td> </tr> <tr class="rowColor"> <td class="colFirst"><code>protected <a href="http://docs.oracle.com/javase/6/docs/api/./javax/activation/DataHandler.html?is-external=true" title="class or interface in javax.activation">DataHandler</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#dh">dh</a></span></code> <div class="block">The DataHandler object representing this Part's content.</div> </td> </tr> <tr class="altColor"> <td class="colFirst"><code>protected <a href="../../../javax/mail/internet/InternetHeaders.html" title="class in javax.mail.internet">InternetHeaders</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#headers">headers</a></span></code> <div class="block">The InternetHeaders object that stores all the headers of this body part.</div> </td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="fields.inherited.from.class.javax.mail.BodyPart"> <!-- --> </a> <h3>Fields inherited from class javax.mail.<a href="../../../javax/mail/BodyPart.html" title="class in javax.mail">BodyPart</a></h3> <code><a href="../../../javax/mail/BodyPart.html#parent">parent</a></code></li> </ul> <ul class="blockList"> <li class="blockList"><a name="fields.inherited.from.class.javax.mail.Part"> <!-- --> </a> <h3>Fields inherited from interface javax.mail.<a href="../../../javax/mail/Part.html" title="interface in javax.mail">Part</a></h3> <code><a href="../../../javax/mail/Part.html#ATTACHMENT">ATTACHMENT</a>, <a href="../../../javax/mail/Part.html#INLINE">INLINE</a></code></li> </ul> </li> </ul> <!-- ======== CONSTRUCTOR SUMMARY ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor.summary"> <!-- --> </a> <h3>Constructor Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation"> <caption><span>Constructors</span><span class="tabEnd"> </span></caption> <tr> <th class="colOne" scope="col">Constructor and Description</th> </tr> <tr class="altColor"> <td class="colOne"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#MimeBodyPart--">MimeBodyPart</a></span>()</code> <div class="block">An empty MimeBodyPart object is created.</div> </td> </tr> <tr class="rowColor"> <td class="colOne"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#MimeBodyPart-java.io.InputStream-">MimeBodyPart</a></span>(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a> is)</code> <div class="block">Constructs a MimeBodyPart by reading and parsing the data from the specified input stream.</div> </td> </tr> <tr class="altColor"> <td class="colOne"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#MimeBodyPart-javax.mail.internet.InternetHeaders-byte:A-">MimeBodyPart</a></span>(<a href="../../../javax/mail/internet/InternetHeaders.html" title="class in javax.mail.internet">InternetHeaders</a> headers, byte[] content)</code> <div class="block">Constructs a MimeBodyPart using the given header and content bytes.</div> </td> </tr> </table> </li> </ul> <!-- ========== METHOD SUMMARY =========== --> <ul class="blockList"> <li class="blockList"><a name="method.summary"> <!-- --> </a> <h3>Method Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation"> <caption><span id="t0" class="activeTableTab"><span>All Methods</span><span class="tabEnd"> </span></span><span id="t2" class="tableTab"><span><a href="javascript:show(2);">Instance Methods</a></span><span class="tabEnd"> </span></span><span id="t4" class="tableTab"><span><a href="javascript:show(8);">Concrete Methods</a></span><span class="tabEnd"> </span></span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Method and Description</th> </tr> <tr id="i0" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#addHeader-java.lang.String-java.lang.String-">addHeader</a></span>(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> value)</code> <div class="block">Add this value to the existing values for this header_name.</div> </td> </tr> <tr id="i1" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#addHeaderLine-java.lang.String-">addHeaderLine</a></span>(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> line)</code> <div class="block">Add a header line to this body part</div> </td> </tr> <tr id="i2" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#attachFile-java.io.File-">attachFile</a></span>(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file)</code> <div class="block">Use the specified file to provide the data for this part.</div> </td> </tr> <tr id="i3" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#attachFile-java.io.File-java.lang.String-java.lang.String-">attachFile</a></span>(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> contentType, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> encoding)</code> <div class="block">Use the specified file with the specified Content-Type and Content-Transfer-Encoding to provide the data for this part.</div> </td> </tr> <tr id="i4" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#attachFile-java.lang.String-">attachFile</a></span>(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> file)</code> <div class="block">Use the specified file to provide the data for this part.</div> </td> </tr> <tr id="i5" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#attachFile-java.lang.String-java.lang.String-java.lang.String-">attachFile</a></span>(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> file, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> contentType, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> encoding)</code> <div class="block">Use the specified file with the specified Content-Type and Content-Transfer-Encoding to provide the data for this part.</div> </td> </tr> <tr id="i6" class="altColor"> <td class="colFirst"><code><a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/util/Enumeration.html?is-external=true" title="class or interface in java.util">Enumeration</a><<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#getAllHeaderLines--">getAllHeaderLines</a></span>()</code> <div class="block">Get all header lines as an Enumeration of Strings.</div> </td> </tr> <tr id="i7" class="rowColor"> <td class="colFirst"><code><a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/util/Enumeration.html?is-external=true" title="class or interface in java.util">Enumeration</a><<a href="../../../javax/mail/Header.html" title="class in javax.mail">Header</a>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#getAllHeaders--">getAllHeaders</a></span>()</code> <div class="block">Return all the headers from this Message as an Enumeration of Header objects.</div> </td> </tr> <tr id="i8" class="altColor"> <td class="colFirst"><code><a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#getContent--">getContent</a></span>()</code> <div class="block">Return the content as a Java object.</div> </td> </tr> <tr id="i9" class="rowColor"> <td class="colFirst"><code><a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#getContentID--">getContentID</a></span>()</code> <div class="block">Returns the value of the "Content-ID" header field.</div> </td> </tr> <tr id="i10" class="altColor"> <td class="colFirst"><code><a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[]</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#getContentLanguage--">getContentLanguage</a></span>()</code> <div class="block">Get the languages specified in the Content-Language header of this MimePart.</div> </td> </tr> <tr id="i11" class="rowColor"> <td class="colFirst"><code><a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#getContentMD5--">getContentMD5</a></span>()</code> <div class="block">Return the value of the "Content-MD5" header field.</div> </td> </tr> <tr id="i12" class="altColor"> <td class="colFirst"><code>protected <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#getContentStream--">getContentStream</a></span>()</code> <div class="block">Produce the raw bytes of the content.</div> </td> </tr> <tr id="i13" class="rowColor"> <td class="colFirst"><code><a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#getContentType--">getContentType</a></span>()</code> <div class="block">Returns the value of the RFC 822 "Content-Type" header field.</div> </td> </tr> <tr id="i14" class="altColor"> <td class="colFirst"><code><a href="http://docs.oracle.com/javase/6/docs/api/./javax/activation/DataHandler.html?is-external=true" title="class or interface in javax.activation">DataHandler</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#getDataHandler--">getDataHandler</a></span>()</code> <div class="block">Return a DataHandler for this body part's content.</div> </td> </tr> <tr id="i15" class="rowColor"> <td class="colFirst"><code><a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#getDescription--">getDescription</a></span>()</code> <div class="block">Returns the "Content-Description" header field of this body part.</div> </td> </tr> <tr id="i16" class="altColor"> <td class="colFirst"><code><a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#getDisposition--">getDisposition</a></span>()</code> <div class="block">Returns the disposition from the "Content-Disposition" header field.</div> </td> </tr> <tr id="i17" class="rowColor"> <td class="colFirst"><code><a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#getEncoding--">getEncoding</a></span>()</code> <div class="block">Returns the content transfer encoding from the "Content-Transfer-Encoding" header field.</div> </td> </tr> <tr id="i18" class="altColor"> <td class="colFirst"><code><a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#getFileName--">getFileName</a></span>()</code> <div class="block">Get the filename associated with this body part.</div> </td> </tr> <tr id="i19" class="rowColor"> <td class="colFirst"><code><a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[]</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#getHeader-java.lang.String-">getHeader</a></span>(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name)</code> <div class="block">Get all the headers for this header_name.</div> </td> </tr> <tr id="i20" class="altColor"> <td class="colFirst"><code><a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#getHeader-java.lang.String-java.lang.String-">getHeader</a></span>(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> delimiter)</code> <div class="block">Get all the headers for this header name, returned as a single String, with headers separated by the delimiter.</div> </td> </tr> <tr id="i21" class="rowColor"> <td class="colFirst"><code><a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#getInputStream--">getInputStream</a></span>()</code> <div class="block">Return a decoded input stream for this body part's "content".</div> </td> </tr> <tr id="i22" class="altColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#getLineCount--">getLineCount</a></span>()</code> <div class="block">Return the number of lines for the content of this Part.</div> </td> </tr> <tr id="i23" class="rowColor"> <td class="colFirst"><code><a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/util/Enumeration.html?is-external=true" title="class or interface in java.util">Enumeration</a><<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#getMatchingHeaderLines-java.lang.String:A-">getMatchingHeaderLines</a></span>(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[] names)</code> <div class="block">Get matching header lines as an Enumeration of Strings.</div> </td> </tr> <tr id="i24" class="altColor"> <td class="colFirst"><code><a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/util/Enumeration.html?is-external=true" title="class or interface in java.util">Enumeration</a><<a href="../../../javax/mail/Header.html" title="class in javax.mail">Header</a>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#getMatchingHeaders-java.lang.String:A-">getMatchingHeaders</a></span>(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[] names)</code> <div class="block">Return matching headers from this Message as an Enumeration of Header objects.</div> </td> </tr> <tr id="i25" class="rowColor"> <td class="colFirst"><code><a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/util/Enumeration.html?is-external=true" title="class or interface in java.util">Enumeration</a><<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#getNonMatchingHeaderLines-java.lang.String:A-">getNonMatchingHeaderLines</a></span>(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[] names)</code> <div class="block">Get non-matching header lines as an Enumeration of Strings.</div> </td> </tr> <tr id="i26" class="altColor"> <td class="colFirst"><code><a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/util/Enumeration.html?is-external=true" title="class or interface in java.util">Enumeration</a><<a href="../../../javax/mail/Header.html" title="class in javax.mail">Header</a>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#getNonMatchingHeaders-java.lang.String:A-">getNonMatchingHeaders</a></span>(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[] names)</code> <div class="block">Return non-matching headers from this Message as an Enumeration of Header objects.</div> </td> </tr> <tr id="i27" class="rowColor"> <td class="colFirst"><code><a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#getRawInputStream--">getRawInputStream</a></span>()</code> <div class="block">Return an InputStream to the raw data with any Content-Transfer-Encoding intact.</div> </td> </tr> <tr id="i28" class="altColor"> <td class="colFirst"><code>int</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#getSize--">getSize</a></span>()</code> <div class="block">Return the size of the content of this body part in bytes.</div> </td> </tr> <tr id="i29" class="rowColor"> <td class="colFirst"><code>boolean</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#isMimeType-java.lang.String-">isMimeType</a></span>(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> mimeType)</code> <div class="block">Is this Part of the specified MIME type? This method compares <strong>only the <code>primaryType</code> and <code>subType</code></strong>.</div> </td> </tr> <tr id="i30" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#removeHeader-java.lang.String-">removeHeader</a></span>(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name)</code> <div class="block">Remove all headers with this name.</div> </td> </tr> <tr id="i31" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#saveFile-java.io.File-">saveFile</a></span>(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file)</code> <div class="block">Save the contents of this part in the specified file.</div> </td> </tr> <tr id="i32" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#saveFile-java.lang.String-">saveFile</a></span>(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> file)</code> <div class="block">Save the contents of this part in the specified file.</div> </td> </tr> <tr id="i33" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#setContent-javax.mail.Multipart-">setContent</a></span>(<a href="../../../javax/mail/Multipart.html" title="class in javax.mail">Multipart</a> mp)</code> <div class="block">This method sets the body part's content to a Multipart object.</div> </td> </tr> <tr id="i34" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#setContent-java.lang.Object-java.lang.String-">setContent</a></span>(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> o, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> type)</code> <div class="block">A convenience method for setting this body part's content.</div> </td> </tr> <tr id="i35" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#setContentID-java.lang.String-">setContentID</a></span>(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> cid)</code> <div class="block">Set the "Content-ID" header field of this body part.</div> </td> </tr> <tr id="i36" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#setContentLanguage-java.lang.String:A-">setContentLanguage</a></span>(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[] languages)</code> <div class="block">Set the Content-Language header of this MimePart.</div> </td> </tr> <tr id="i37" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#setContentMD5-java.lang.String-">setContentMD5</a></span>(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> md5)</code> <div class="block">Set the "Content-MD5" header field of this body part.</div> </td> </tr> <tr id="i38" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#setDataHandler-javax.activation.DataHandler-">setDataHandler</a></span>(<a href="http://docs.oracle.com/javase/6/docs/api/./javax/activation/DataHandler.html?is-external=true" title="class or interface in javax.activation">DataHandler</a> dh)</code> <div class="block">This method provides the mechanism to set this body part's content.</div> </td> </tr> <tr id="i39" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#setDescription-java.lang.String-">setDescription</a></span>(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> description)</code> <div class="block">Set the "Content-Description" header field for this body part.</div> </td> </tr> <tr id="i40" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#setDescription-java.lang.String-java.lang.String-">setDescription</a></span>(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> description, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> charset)</code> <div class="block">Set the "Content-Description" header field for this body part.</div> </td> </tr> <tr id="i41" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#setDisposition-java.lang.String-">setDisposition</a></span>(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> disposition)</code> <div class="block">Set the disposition in the "Content-Disposition" header field of this body part.</div> </td> </tr> <tr id="i42" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#setFileName-java.lang.String-">setFileName</a></span>(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> filename)</code> <div class="block">Set the filename associated with this body part, if possible.</div> </td> </tr> <tr id="i43" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#setHeader-java.lang.String-java.lang.String-">setHeader</a></span>(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> value)</code> <div class="block">Set the value for this header_name.</div> </td> </tr> <tr id="i44" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#setText-java.lang.String-">setText</a></span>(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> text)</code> <div class="block">Convenience method that sets the given String as this part's content, with a MIME type of "text/plain".</div> </td> </tr> <tr id="i45" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#setText-java.lang.String-java.lang.String-">setText</a></span>(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> text, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> charset)</code> <div class="block">Convenience method that sets the given String as this part's content, with a MIME type of "text/plain" and the specified charset.</div> </td> </tr> <tr id="i46" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#setText-java.lang.String-java.lang.String-java.lang.String-">setText</a></span>(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> text, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> charset, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> subtype)</code> <div class="block">Convenience method that sets the given String as this part's content, with a primary MIME type of "text" and the specified MIME subtype.</div> </td> </tr> <tr id="i47" class="rowColor"> <td class="colFirst"><code>protected void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#updateHeaders--">updateHeaders</a></span>()</code> <div class="block">Examine the content of this body part and update the appropriate MIME headers.</div> </td> </tr> <tr id="i48" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/MimeBodyPart.html#writeTo-java.io.OutputStream-">writeTo</a></span>(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</a> os)</code> <div class="block">Output the body part as an RFC 822 format stream.</div> </td> </tr> </table> <ul class="blockList"> <li class="blockList"><a name="methods.inherited.from.class.javax.mail.BodyPart"> <!-- --> </a> <h3>Methods inherited from class javax.mail.<a href="../../../javax/mail/BodyPart.html" title="class in javax.mail">BodyPart</a></h3> <code><a href="../../../javax/mail/BodyPart.html#getParent--">getParent</a></code></li> </ul> <ul class="blockList"> <li class="blockList"><a name="methods.inherited.from.class.java.lang.Object"> <!-- --> </a> <h3>Methods inherited from class java.lang.<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3> <code><a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/Object.html?is-external=true#clone--" title="class or interface in java.lang">clone</a>, <a href="http://docs.oracle.com/javase/1.5.0/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://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/Object.html?is-external=true#finalize--" title="class or interface in java.lang">finalize</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/Object.html?is-external=true#getClass--" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/Object.html?is-external=true#hashCode--" title="class or interface in java.lang">hashCode</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/Object.html?is-external=true#notify--" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/Object.html?is-external=true#notifyAll--" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/Object.html?is-external=true#toString--" title="class or interface in java.lang">toString</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/Object.html?is-external=true#wait--" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/Object.html?is-external=true#wait-long-" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/Object.html?is-external=true#wait-long-int-" title="class or interface in java.lang">wait</a></code></li> </ul> </li> </ul> </li> </ul> </div> <div class="details"> <ul class="blockList"> <li class="blockList"> <!-- ============ FIELD DETAIL =========== --> <ul class="blockList"> <li class="blockList"><a name="field.detail"> <!-- --> </a> <h3>Field Detail</h3> <a name="dh"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>dh</h4> <pre>protected <a href="http://docs.oracle.com/javase/6/docs/api/./javax/activation/DataHandler.html?is-external=true" title="class or interface in javax.activation">DataHandler</a> dh</pre> <div class="block">The DataHandler object representing this Part's content.</div> </li> </ul> <a name="content"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>content</h4> <pre>protected byte[] content</pre> <div class="block">Byte array that holds the bytes of the content of this Part.</div> </li> </ul> <a name="contentStream"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>contentStream</h4> <pre>protected <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a> contentStream</pre> <div class="block">If the data for this body part was supplied by an InputStream that implements the SharedInputStream interface, <code>contentStream</code> is another such stream representing the content of this body part. In this case, <code>content</code> will be null.</div> <dl> <dt><span class="simpleTagLabel">Since:</span></dt> <dd>JavaMail 1.2</dd> </dl> </li> </ul> <a name="headers"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>headers</h4> <pre>protected <a href="../../../javax/mail/internet/InternetHeaders.html" title="class in javax.mail.internet">InternetHeaders</a> headers</pre> <div class="block">The InternetHeaders object that stores all the headers of this body part.</div> </li> </ul> <a name="cachedContent"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>cachedContent</h4> <pre>protected <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> cachedContent</pre> <div class="block">If our content is a Multipart of Message object, we save it the first time it's created by parsing a stream so that changes to the contained objects will not be lost. If this field is not null, it's return by the <a href="../../../javax/mail/internet/MimeBodyPart.html#getContent--"><code>getContent()</code></a> method. The <a href="../../../javax/mail/internet/MimeBodyPart.html#getContent--"><code>getContent()</code></a> method sets this field if it would return a Multipart or MimeMessage object. This field is is cleared by the <a href="../../../javax/mail/internet/MimeBodyPart.html#setDataHandler-javax.activation.DataHandler-"><code>setDataHandler(javax.activation.DataHandler)</code></a> method.</div> <dl> <dt><span class="simpleTagLabel">Since:</span></dt> <dd>JavaMail 1.5</dd> </dl> </li> </ul> </li> </ul> <!-- ========= CONSTRUCTOR DETAIL ======== --> <ul class="blockList"> <li class="blockList"><a name="constructor.detail"> <!-- --> </a> <h3>Constructor Detail</h3> <a name="MimeBodyPart--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>MimeBodyPart</h4> <pre>public MimeBodyPart()</pre> <div class="block">An empty MimeBodyPart object is created. This body part maybe filled in by a client constructing a multipart message.</div> </li> </ul> <a name="MimeBodyPart-java.io.InputStream-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>MimeBodyPart</h4> <pre>public MimeBodyPart(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a> is) throws <a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></pre> <div class="block">Constructs a MimeBodyPart by reading and parsing the data from the specified input stream. The parser consumes data till the end of the given input stream. The input stream must start at the beginning of a valid MIME body part and must terminate at the end of that body part. <p> Note that the "boundary" string that delimits body parts must <strong>not</strong> be included in the input stream. The intention is that the MimeMultipart parser will extract each body part's bytes from a multipart stream and feed them into this constructor, without the delimiter strings.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>is</code> - the body part Input Stream</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></code> - for failures</dd> </dl> </li> </ul> <a name="MimeBodyPart-javax.mail.internet.InternetHeaders-byte:A-"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>MimeBodyPart</h4> <pre>public MimeBodyPart(<a href="../../../javax/mail/internet/InternetHeaders.html" title="class in javax.mail.internet">InternetHeaders</a> headers, byte[] content) throws <a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></pre> <div class="block">Constructs a MimeBodyPart using the given header and content bytes. <p> Used by providers.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>headers</code> - The header of this part</dd> <dd><code>content</code> - bytes representing the body of this part.</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></code> - for failures</dd> </dl> </li> </ul> </li> </ul> <!-- ============ METHOD DETAIL ========== --> <ul class="blockList"> <li class="blockList"><a name="method.detail"> <!-- --> </a> <h3>Method Detail</h3> <a name="getSize--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getSize</h4> <pre>public int getSize() throws <a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></pre> <div class="block">Return the size of the content of this body part in bytes. Return -1 if the size cannot be determined. <p> Note that this number may not be an exact measure of the content size and may or may not account for any transfer encoding of the content. <p> This implementation returns the size of the <code>content</code> array (if not null), or, if <code>contentStream</code> is not null, and the <code>available</code> method returns a positive number, it returns that number as the size. Otherwise, it returns -1.</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../javax/mail/Part.html#getSize--">getSize</a></code> in interface <code><a href="../../../javax/mail/Part.html" title="interface in javax.mail">Part</a></code></dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>size in bytes, or -1 if not known</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></code> - for failures</dd> </dl> </li> </ul> <a name="getLineCount--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getLineCount</h4> <pre>public int getLineCount() throws <a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></pre> <div class="block">Return the number of lines for the content of this Part. Return -1 if this number cannot be determined. <p> Note that this number may not be an exact measure of the content length and may or may not account for any transfer encoding of the content. <p> This implementation returns -1.</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../javax/mail/Part.html#getLineCount--">getLineCount</a></code> in interface <code><a href="../../../javax/mail/Part.html" title="interface in javax.mail">Part</a></code></dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>number of lines, or -1 if not known</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></code> - for failures</dd> </dl> </li> </ul> <a name="getContentType--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getContentType</h4> <pre>public <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> getContentType() throws <a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></pre> <div class="block">Returns the value of the RFC 822 "Content-Type" header field. This represents the content type of the content of this body part. This value must not be null. If this field is unavailable, "text/plain" should be returned. <p> This implementation uses <code>getHeader(name)</code> to obtain the requisite header field.</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../javax/mail/Part.html#getContentType--">getContentType</a></code> in interface <code><a href="../../../javax/mail/Part.html" title="interface in javax.mail">Part</a></code></dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>Content-Type of this body part</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></code> - for failures</dd> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="http://docs.oracle.com/javase/6/docs/api/./javax/activation/DataHandler.html?is-external=true" title="class or interface in javax.activation"><code>DataHandler</code></a></dd> </dl> </li> </ul> <a name="isMimeType-java.lang.String-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>isMimeType</h4> <pre>public boolean isMimeType(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> mimeType) throws <a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></pre> <div class="block">Is this Part of the specified MIME type? This method compares <strong>only the <code>primaryType</code> and <code>subType</code></strong>. The parameters of the content types are ignored. <p> For example, this method will return <code>true</code> when comparing a Part of content type <strong>"text/plain"</strong> with <strong>"text/plain; charset=foobar"</strong>. <p> If the <code>subType</code> of <code>mimeType</code> is the special character '*', then the subtype is ignored during the comparison.</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../javax/mail/Part.html#isMimeType-java.lang.String-">isMimeType</a></code> in interface <code><a href="../../../javax/mail/Part.html" title="interface in javax.mail">Part</a></code></dd> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>mimeType</code> - the MIME type to test</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>true if this part is of the specified type</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></code> - for failures</dd> </dl> </li> </ul> <a name="getDisposition--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getDisposition</h4> <pre>public <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> getDisposition() throws <a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></pre> <div class="block">Returns the disposition from the "Content-Disposition" header field. This represents the disposition of this part. The disposition describes how the part should be presented to the user. <p> If the Content-Disposition field is unavailable, null is returned. <p> This implementation uses <code>getHeader(name)</code> to obtain the requisite header field.</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../javax/mail/Part.html#getDisposition--">getDisposition</a></code> in interface <code><a href="../../../javax/mail/Part.html" title="interface in javax.mail">Part</a></code></dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>disposition of this part, or null if unknown</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></code> - for failures</dd> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javax/mail/internet/MimeBodyPart.html#headers"><code>headers</code></a></dd> </dl> </li> </ul> <a name="setDisposition-java.lang.String-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setDisposition</h4> <pre>public void setDisposition(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> disposition) throws <a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></pre> <div class="block">Set the disposition in the "Content-Disposition" header field of this body part. If the disposition is null, any existing "Content-Disposition" header field is removed.</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../javax/mail/Part.html#setDisposition-java.lang.String-">setDisposition</a></code> in interface <code><a href="../../../javax/mail/Part.html" title="interface in javax.mail">Part</a></code></dd> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>disposition</code> - disposition of this part</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../../../javax/mail/IllegalWriteException.html" title="class in javax.mail">IllegalWriteException</a></code> - if the underlying implementation does not support modification</dd> <dd><code><a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</a></code> - if this body part is obtained from a READ_ONLY folder.</dd> <dd><code><a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></code> - for other failures</dd> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javax/mail/Part.html#ATTACHMENT"><code>Part.ATTACHMENT</code></a>, <a href="../../../javax/mail/Part.html#INLINE"><code>Part.INLINE</code></a>, <a href="../../../javax/mail/Part.html#setFileName-java.lang.String-"><code>Part.setFileName(java.lang.String)</code></a></dd> </dl> </li> </ul> <a name="getEncoding--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getEncoding</h4> <pre>public <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> getEncoding() throws <a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></pre> <div class="block">Returns the content transfer encoding from the "Content-Transfer-Encoding" header field. Returns <code>null</code> if the header is unavailable or its value is absent. <p> This implementation uses <code>getHeader(name)</code> to obtain the requisite header field.</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../javax/mail/internet/MimePart.html#getEncoding--">getEncoding</a></code> in interface <code><a href="../../../javax/mail/internet/MimePart.html" title="interface in javax.mail.internet">MimePart</a></code></dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>content-transfer-encoding</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></code> - for failures</dd> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javax/mail/internet/MimeBodyPart.html#headers"><code>headers</code></a></dd> </dl> </li> </ul> <a name="getContentID--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getContentID</h4> <pre>public <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> getContentID() throws <a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></pre> <div class="block">Returns the value of the "Content-ID" header field. Returns <code>null</code> if the field is unavailable or its value is absent. <p> This implementation uses <code>getHeader(name)</code> to obtain the requisite header field.</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../javax/mail/internet/MimePart.html#getContentID--">getContentID</a></code> in interface <code><a href="../../../javax/mail/internet/MimePart.html" title="interface in javax.mail.internet">MimePart</a></code></dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>content-ID</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></code> - for failures</dd> </dl> </li> </ul> <a name="setContentID-java.lang.String-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setContentID</h4> <pre>public void setContentID(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> cid) throws <a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></pre> <div class="block">Set the "Content-ID" header field of this body part. If the <code>cid</code> parameter is null, any existing "Content-ID" is removed.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>cid</code> - the Content-ID</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../../../javax/mail/IllegalWriteException.html" title="class in javax.mail">IllegalWriteException</a></code> - if the underlying implementation does not support modification</dd> <dd><code><a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</a></code> - if this body part is obtained from a READ_ONLY folder.</dd> <dd><code><a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></code> - for other failures</dd> <dt><span class="simpleTagLabel">Since:</span></dt> <dd>JavaMail 1.3</dd> </dl> </li> </ul> <a name="getContentMD5--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getContentMD5</h4> <pre>public <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> getContentMD5() throws <a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></pre> <div class="block">Return the value of the "Content-MD5" header field. Returns <code>null</code> if this field is unavailable or its value is absent. <p> This implementation uses <code>getHeader(name)</code> to obtain the requisite header field.</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../javax/mail/internet/MimePart.html#getContentMD5--">getContentMD5</a></code> in interface <code><a href="../../../javax/mail/internet/MimePart.html" title="interface in javax.mail.internet">MimePart</a></code></dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>content-MD5</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></code> - for failures</dd> </dl> </li> </ul> <a name="setContentMD5-java.lang.String-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setContentMD5</h4> <pre>public void setContentMD5(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> md5) throws <a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></pre> <div class="block">Set the "Content-MD5" header field of this body part.</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../javax/mail/internet/MimePart.html#setContentMD5-java.lang.String-">setContentMD5</a></code> in interface <code><a href="../../../javax/mail/internet/MimePart.html" title="interface in javax.mail.internet">MimePart</a></code></dd> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>md5</code> - the MD5 value</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../../../javax/mail/IllegalWriteException.html" title="class in javax.mail">IllegalWriteException</a></code> - if the underlying implementation does not support modification</dd> <dd><code><a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</a></code> - if this body part is obtained from a READ_ONLY folder.</dd> <dd><code><a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></code></dd> </dl> </li> </ul> <a name="getContentLanguage--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getContentLanguage</h4> <pre>public <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[] getContentLanguage() throws <a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></pre> <div class="block">Get the languages specified in the Content-Language header of this MimePart. The Content-Language header is defined by RFC 1766. Returns <code>null</code> if this header is not available or its value is absent. <p> This implementation uses <code>getHeader(name)</code> to obtain the requisite header field.</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../javax/mail/internet/MimePart.html#getContentLanguage--">getContentLanguage</a></code> in interface <code><a href="../../../javax/mail/internet/MimePart.html" title="interface in javax.mail.internet">MimePart</a></code></dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>array of content language strings</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></code> - for failures</dd> </dl> </li> </ul> <a name="setContentLanguage-java.lang.String:A-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setContentLanguage</h4> <pre>public void setContentLanguage(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[] languages) throws <a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></pre> <div class="block">Set the Content-Language header of this MimePart. The Content-Language header is defined by RFC 1766.</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../javax/mail/internet/MimePart.html#setContentLanguage-java.lang.String:A-">setContentLanguage</a></code> in interface <code><a href="../../../javax/mail/internet/MimePart.html" title="interface in javax.mail.internet">MimePart</a></code></dd> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>languages</code> - array of language tags</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../../../javax/mail/IllegalWriteException.html" title="class in javax.mail">IllegalWriteException</a></code> - if the underlying implementation does not support modification</dd> <dd><code><a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></code></dd> </dl> </li> </ul> <a name="getDescription--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getDescription</h4> <pre>public <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> getDescription() throws <a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></pre> <div class="block">Returns the "Content-Description" header field of this body part. This typically associates some descriptive information with this part. Returns null if this field is unavailable or its value is absent. <p> If the Content-Description field is encoded as per RFC 2047, it is decoded and converted into Unicode. If the decoding or conversion fails, the raw data is returned as is. <p> This implementation uses <code>getHeader(name)</code> to obtain the requisite header field.</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../javax/mail/Part.html#getDescription--">getDescription</a></code> in interface <code><a href="../../../javax/mail/Part.html" title="interface in javax.mail">Part</a></code></dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>content description</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></code> - for failures</dd> </dl> </li> </ul> <a name="setDescription-java.lang.String-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setDescription</h4> <pre>public void setDescription(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> description) throws <a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></pre> <div class="block">Set the "Content-Description" header field for this body part. If the description parameter is <code>null</code>, then any existing "Content-Description" fields are removed. <p> If the description contains non US-ASCII characters, it will be encoded using the platform's default charset. If the description contains only US-ASCII characters, no encoding is done and it is used as is. <p> Note that if the charset encoding process fails, a MessagingException is thrown, and an UnsupportedEncodingException is included in the chain of nested exceptions within the MessagingException.</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../javax/mail/Part.html#setDescription-java.lang.String-">setDescription</a></code> in interface <code><a href="../../../javax/mail/Part.html" title="interface in javax.mail">Part</a></code></dd> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>description</code> - content description</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../../../javax/mail/IllegalWriteException.html" title="class in javax.mail">IllegalWriteException</a></code> - if the underlying implementation does not support modification</dd> <dd><code><a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</a></code> - if this body part is obtained from a READ_ONLY folder.</dd> <dd><code><a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></code> - otherwise; an UnsupportedEncodingException may be included in the exception chain if the charset conversion fails.</dd> </dl> </li> </ul> <a name="setDescription-java.lang.String-java.lang.String-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setDescription</h4> <pre>public void setDescription(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> description, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> charset) throws <a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></pre> <div class="block">Set the "Content-Description" header field for this body part. If the description parameter is <code>null</code>, then any existing "Content-Description" fields are removed. <p> If the description contains non US-ASCII characters, it will be encoded using the specified charset. If the description contains only US-ASCII characters, no encoding is done and it is used as is. <p> Note that if the charset encoding process fails, a MessagingException is thrown, and an UnsupportedEncodingException is included in the chain of nested exceptions within the MessagingException.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>description</code> - Description</dd> <dd><code>charset</code> - Charset for encoding</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../../../javax/mail/IllegalWriteException.html" title="class in javax.mail">IllegalWriteException</a></code> - if the underlying implementation does not support modification</dd> <dd><code><a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</a></code> - if this body part is obtained from a READ_ONLY folder.</dd> <dd><code><a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></code> - otherwise; an UnsupportedEncodingException may be included in the exception chain if the charset conversion fails.</dd> </dl> </li> </ul> <a name="getFileName--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getFileName</h4> <pre>public <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> getFileName() throws <a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></pre> <div class="block">Get the filename associated with this body part. <p> Returns the value of the "filename" parameter from the "Content-Disposition" header field of this body part. If its not available, returns the value of the "name" parameter from the "Content-Type" header field of this body part. Returns <code>null</code> if both are absent. <p> If the <code>mail.mime.decodefilename</code> System property is set to true, the <a href="../../../javax/mail/internet/MimeUtility.html#decodeText-java.lang.String-"><code>MimeUtility.decodeText</code></a> method will be used to decode the filename. While such encoding is not supported by the MIME spec, many mailers use this technique to support non-ASCII characters in filenames. The default value of this property is false.</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../javax/mail/Part.html#getFileName--">getFileName</a></code> in interface <code><a href="../../../javax/mail/Part.html" title="interface in javax.mail">Part</a></code></dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>filename</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></code> - for failures</dd> </dl> </li> </ul> <a name="setFileName-java.lang.String-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setFileName</h4> <pre>public void setFileName(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> filename) throws <a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></pre> <div class="block">Set the filename associated with this body part, if possible. <p> Sets the "filename" parameter of the "Content-Disposition" header field of this body part. For compatibility with older mailers, the "name" parameter of the "Content-Type" header is also set. <p> If the <code>mail.mime.encodefilename</code> System property is set to true, the <a href="../../../javax/mail/internet/MimeUtility.html#encodeText-java.lang.String-"><code>MimeUtility.encodeText</code></a> method will be used to encode the filename. While such encoding is not supported by the MIME spec, many mailers use this technique to support non-ASCII characters in filenames. The default value of this property is false.</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../javax/mail/Part.html#setFileName-java.lang.String-">setFileName</a></code> in interface <code><a href="../../../javax/mail/Part.html" title="interface in javax.mail">Part</a></code></dd> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>filename</code> - the file name</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../../../javax/mail/IllegalWriteException.html" title="class in javax.mail">IllegalWriteException</a></code> - if the underlying implementation does not support modification</dd> <dd><code><a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</a></code> - if this body part is obtained from a READ_ONLY folder.</dd> <dd><code><a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></code> - for other failures</dd> </dl> </li> </ul> <a name="getInputStream--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getInputStream</h4> <pre>public <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a> getInputStream() throws <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a>, <a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></pre> <div class="block">Return a decoded input stream for this body part's "content". <p> This implementation obtains the input stream from the DataHandler. That is, it invokes getDataHandler().getInputStream();</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../javax/mail/Part.html#getInputStream--">getInputStream</a></code> in interface <code><a href="../../../javax/mail/Part.html" title="interface in javax.mail">Part</a></code></dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>an InputStream</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - this is typically thrown by the DataHandler. Refer to the documentation for javax.activation.DataHandler for more details.</dd> <dd><code><a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></code> - for other failures</dd> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javax/mail/internet/MimeBodyPart.html#getContentStream--"><code>getContentStream()</code></a>, <a href="http://docs.oracle.com/javase/6/docs/api/./javax/activation/DataHandler.html?is-external=true#getInputStream--" title="class or interface in javax.activation"><code>DataHandler.getInputStream()</code></a></dd> </dl> </li> </ul> <a name="getContentStream--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getContentStream</h4> <pre>protected <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a> getContentStream() throws <a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></pre> <div class="block">Produce the raw bytes of the content. This method is used when creating a DataHandler object for the content. Subclasses that can provide a separate input stream for just the Part content might want to override this method. <p></div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>an InputStream containing the raw bytes</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></code> - for failures</dd> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javax/mail/internet/MimeBodyPart.html#content"><code>content</code></a>, <a href="../../../javax/mail/internet/MimeMessage.html#getContentStream--"><code>MimeMessage.getContentStream()</code></a></dd> </dl> </li> </ul> <a name="getRawInputStream--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getRawInputStream</h4> <pre>public <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</a> getRawInputStream() throws <a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></pre> <div class="block">Return an InputStream to the raw data with any Content-Transfer-Encoding intact. This method is useful if the "Content-Transfer-Encoding" header is incorrect or corrupt, which would prevent the <code>getInputStream</code> method or <code>getContent</code> method from returning the correct data. In such a case the application may use this method and attempt to decode the raw data itself. <p> This implementation simply calls the <code>getContentStream</code> method.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>an InputStream containing the raw bytes</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></code> - for failures</dd> <dt><span class="simpleTagLabel">Since:</span></dt> <dd>JavaMail 1.2</dd> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javax/mail/internet/MimeBodyPart.html#getInputStream--"><code>getInputStream()</code></a>, <a href="../../../javax/mail/internet/MimeBodyPart.html#getContentStream--"><code>getContentStream()</code></a></dd> </dl> </li> </ul> <a name="getDataHandler--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getDataHandler</h4> <pre>public <a href="http://docs.oracle.com/javase/6/docs/api/./javax/activation/DataHandler.html?is-external=true" title="class or interface in javax.activation">DataHandler</a> getDataHandler() throws <a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></pre> <div class="block">Return a DataHandler for this body part's content. <p> The implementation provided here works just like the the implementation in MimeMessage.</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../javax/mail/Part.html#getDataHandler--">getDataHandler</a></code> in interface <code><a href="../../../javax/mail/Part.html" title="interface in javax.mail">Part</a></code></dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>DataHandler for the content</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></code> - for failures</dd> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javax/mail/internet/MimeMessage.html#getDataHandler--"><code>MimeMessage.getDataHandler()</code></a></dd> </dl> </li> </ul> <a name="getContent--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getContent</h4> <pre>public <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> getContent() throws <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a>, <a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></pre> <div class="block">Return the content as a Java object. The type of the object returned is of course dependent on the content itself. For example, the native format of a text/plain content is usually a String object. The native format for a "multipart" content is always a Multipart subclass. For content types that are unknown to the DataHandler system, an input stream is returned as the content. <p> This implementation obtains the content from the DataHandler. That is, it invokes getDataHandler().getContent(); If the content is a Multipart or Message object and was created by parsing a stream, the object is cached and returned in subsequent calls so that modifications to the content will not be lost.</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../javax/mail/Part.html#getContent--">getContent</a></code> in interface <code><a href="../../../javax/mail/Part.html" title="interface in javax.mail">Part</a></code></dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>Object</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - this is typically thrown by the DataHandler. Refer to the documentation for javax.activation.DataHandler for more details.</dd> <dd><code><a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></code> - for other failures</dd> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="http://docs.oracle.com/javase/6/docs/api/./javax/activation/DataHandler.html?is-external=true#getContent--" title="class or interface in javax.activation"><code>DataHandler.getContent()</code></a></dd> </dl> </li> </ul> <a name="setDataHandler-javax.activation.DataHandler-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setDataHandler</h4> <pre>public void setDataHandler(<a href="http://docs.oracle.com/javase/6/docs/api/./javax/activation/DataHandler.html?is-external=true" title="class or interface in javax.activation">DataHandler</a> dh) throws <a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></pre> <div class="block">This method provides the mechanism to set this body part's content. The given DataHandler object should wrap the actual content.</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../javax/mail/Part.html#setDataHandler-javax.activation.DataHandler-">setDataHandler</a></code> in interface <code><a href="../../../javax/mail/Part.html" title="interface in javax.mail">Part</a></code></dd> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>dh</code> - The DataHandler for the content</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../../../javax/mail/IllegalWriteException.html" title="class in javax.mail">IllegalWriteException</a></code> - if the underlying implementation does not support modification</dd> <dd><code><a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</a></code> - if this body part is obtained from a READ_ONLY folder.</dd> <dd><code><a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></code> - for other failures</dd> </dl> </li> </ul> <a name="setContent-java.lang.Object-java.lang.String-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setContent</h4> <pre>public void setContent(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a> o, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> type) throws <a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></pre> <div class="block">A convenience method for setting this body part's content. <p> The content is wrapped in a DataHandler object. Note that a DataContentHandler class for the specified type should be available to the JavaMail implementation for this to work right. That is, to do <code>setContent(foobar, "application/x-foobar")</code>, a DataContentHandler for "application/x-foobar" should be installed. Refer to the Java Activation Framework for more information.</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../javax/mail/Part.html#setContent-java.lang.Object-java.lang.String-">setContent</a></code> in interface <code><a href="../../../javax/mail/Part.html" title="interface in javax.mail">Part</a></code></dd> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>o</code> - the content object</dd> <dd><code>type</code> - Mime type of the object</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../../../javax/mail/IllegalWriteException.html" title="class in javax.mail">IllegalWriteException</a></code> - if the underlying implementation does not support modification of existing values</dd> <dd><code><a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</a></code> - if this body part is obtained from a READ_ONLY folder.</dd> <dd><code><a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></code> - for other failures</dd> </dl> </li> </ul> <a name="setText-java.lang.String-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setText</h4> <pre>public void setText(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> text) throws <a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></pre> <div class="block">Convenience method that sets the given String as this part's content, with a MIME type of "text/plain". If the string contains non US-ASCII characters, it will be encoded using the platform's default charset. The charset is also used to set the "charset" parameter. <p> Note that there may be a performance penalty if <code>text</code> is large, since this method may have to scan all the characters to determine what charset to use. <p> If the charset is already known, use the <code>setText</code> method that takes the charset parameter.</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../javax/mail/internet/MimePart.html#setText-java.lang.String-">setText</a></code> in interface <code><a href="../../../javax/mail/internet/MimePart.html" title="interface in javax.mail.internet">MimePart</a></code></dd> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../javax/mail/Part.html#setText-java.lang.String-">setText</a></code> in interface <code><a href="../../../javax/mail/Part.html" title="interface in javax.mail">Part</a></code></dd> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>text</code> - the text content to set</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></code> - if an error occurs</dd> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javax/mail/internet/MimeBodyPart.html#setText-java.lang.String-java.lang.String-"><code>setText(String text, String charset)</code></a></dd> </dl> </li> </ul> <a name="setText-java.lang.String-java.lang.String-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setText</h4> <pre>public void setText(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> text, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> charset) throws <a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></pre> <div class="block">Convenience method that sets the given String as this part's content, with a MIME type of "text/plain" and the specified charset. The given Unicode string will be charset-encoded using the specified charset. The charset is also used to set the "charset" parameter.</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../javax/mail/internet/MimePart.html#setText-java.lang.String-java.lang.String-">setText</a></code> in interface <code><a href="../../../javax/mail/internet/MimePart.html" title="interface in javax.mail.internet">MimePart</a></code></dd> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>text</code> - the text content to set</dd> <dd><code>charset</code> - the charset to use for the text</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></code> - if an error occurs</dd> </dl> </li> </ul> <a name="setText-java.lang.String-java.lang.String-java.lang.String-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setText</h4> <pre>public void setText(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> text, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> charset, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" 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> <div class="block">Convenience method that sets the given String as this part's content, with a primary MIME type of "text" and the specified MIME subtype. The given Unicode string will be charset-encoded using the specified charset. The charset is also used to set the "charset" parameter.</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../javax/mail/internet/MimePart.html#setText-java.lang.String-java.lang.String-java.lang.String-">setText</a></code> in interface <code><a href="../../../javax/mail/internet/MimePart.html" title="interface in javax.mail.internet">MimePart</a></code></dd> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>text</code> - the text content to set</dd> <dd><code>charset</code> - the charset to use for the text</dd> <dd><code>subtype</code> - the MIME subtype to use (e.g., "html")</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></code> - if an error occurs</dd> <dt><span class="simpleTagLabel">Since:</span></dt> <dd>JavaMail 1.4</dd> </dl> </li> </ul> <a name="setContent-javax.mail.Multipart-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setContent</h4> <pre>public void setContent(<a href="../../../javax/mail/Multipart.html" title="class in javax.mail">Multipart</a> mp) throws <a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></pre> <div class="block">This method sets the body part's content to a Multipart object.</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../javax/mail/Part.html#setContent-javax.mail.Multipart-">setContent</a></code> in interface <code><a href="../../../javax/mail/Part.html" title="interface in javax.mail">Part</a></code></dd> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>mp</code> - The multipart object that is the Message's content</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../../../javax/mail/IllegalWriteException.html" title="class in javax.mail">IllegalWriteException</a></code> - if the underlying implementation does not support modification of existing values.</dd> <dd><code><a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</a></code> - if this body part is obtained from a READ_ONLY folder.</dd> <dd><code><a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></code> - for other failures</dd> </dl> </li> </ul> <a name="attachFile-java.io.File-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>attachFile</h4> <pre>public void attachFile(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file) throws <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a>, <a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></pre> <div class="block">Use the specified file to provide the data for this part. The simple file name is used as the file name for this part and the data in the file is used as the data for this part. The encoding will be chosen appropriately for the file data. The disposition of this part is set to <a href="../../../javax/mail/Part.html#ATTACHMENT"><code>Part.ATTACHMENT</code></a>.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>file</code> - the File object to attach</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - errors related to accessing the file</dd> <dd><code><a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></code> - message related errors</dd> <dt><span class="simpleTagLabel">Since:</span></dt> <dd>JavaMail 1.4</dd> </dl> </li> </ul> <a name="attachFile-java.lang.String-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>attachFile</h4> <pre>public void attachFile(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> file) throws <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a>, <a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></pre> <div class="block">Use the specified file to provide the data for this part. The simple file name is used as the file name for this part and the data in the file is used as the data for this part. The encoding will be chosen appropriately for the file data.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>file</code> - the name of the file to attach</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - errors related to accessing the file</dd> <dd><code><a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></code> - message related errors</dd> <dt><span class="simpleTagLabel">Since:</span></dt> <dd>JavaMail 1.4</dd> </dl> </li> </ul> <a name="attachFile-java.io.File-java.lang.String-java.lang.String-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>attachFile</h4> <pre>public void attachFile(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> contentType, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> encoding) throws <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a>, <a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></pre> <div class="block">Use the specified file with the specified Content-Type and Content-Transfer-Encoding to provide the data for this part. If contentType or encoding are null, appropriate values will be chosen. The simple file name is used as the file name for this part and the data in the file is used as the data for this part. The disposition of this part is set to <a href="../../../javax/mail/Part.html#ATTACHMENT"><code>Part.ATTACHMENT</code></a>.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>file</code> - the File object to attach</dd> <dd><code>contentType</code> - the Content-Type, or null</dd> <dd><code>encoding</code> - the Content-Transfer-Encoding, or null</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - errors related to accessing the file</dd> <dd><code><a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></code> - message related errors</dd> <dt><span class="simpleTagLabel">Since:</span></dt> <dd>JavaMail 1.5</dd> </dl> </li> </ul> <a name="attachFile-java.lang.String-java.lang.String-java.lang.String-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>attachFile</h4> <pre>public void attachFile(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> file, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> contentType, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> encoding) throws <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a>, <a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></pre> <div class="block">Use the specified file with the specified Content-Type and Content-Transfer-Encoding to provide the data for this part. If contentType or encoding are null, appropriate values will be chosen. The simple file name is used as the file name for this part and the data in the file is used as the data for this part. The disposition of this part is set to <a href="../../../javax/mail/Part.html#ATTACHMENT"><code>Part.ATTACHMENT</code></a>.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>file</code> - the name of the file</dd> <dd><code>contentType</code> - the Content-Type, or null</dd> <dd><code>encoding</code> - the Content-Transfer-Encoding, or null</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - errors related to accessing the file</dd> <dd><code><a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></code> - message related errors</dd> <dt><span class="simpleTagLabel">Since:</span></dt> <dd>JavaMail 1.5</dd> </dl> </li> </ul> <a name="saveFile-java.io.File-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>saveFile</h4> <pre>public void saveFile(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/io/File.html?is-external=true" title="class or interface in java.io">File</a> file) throws <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a>, <a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></pre> <div class="block">Save the contents of this part in the specified file. The content is decoded and saved, without any of the MIME headers.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>file</code> - the File object to write to</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - errors related to accessing the file</dd> <dd><code><a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></code> - message related errors</dd> <dt><span class="simpleTagLabel">Since:</span></dt> <dd>JavaMail 1.4</dd> </dl> </li> </ul> <a name="saveFile-java.lang.String-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>saveFile</h4> <pre>public void saveFile(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> file) throws <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a>, <a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></pre> <div class="block">Save the contents of this part in the specified file. The content is decoded and saved, without any of the MIME headers.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>file</code> - the name of the file to write to</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - errors related to accessing the file</dd> <dd><code><a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></code> - message related errors</dd> <dt><span class="simpleTagLabel">Since:</span></dt> <dd>JavaMail 1.4</dd> </dl> </li> </ul> <a name="writeTo-java.io.OutputStream-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>writeTo</h4> <pre>public void writeTo(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream</a> os) throws <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a>, <a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></pre> <div class="block">Output the body part as an RFC 822 format stream.</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../javax/mail/Part.html#writeTo-java.io.OutputStream-">writeTo</a></code> in interface <code><a href="../../../javax/mail/Part.html" title="interface in javax.mail">Part</a></code></dd> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>os</code> - the stream to write to</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</a></code> - if an error occurs writing to the stream or if an error is generated by the javax.activation layer.</dd> <dd><code><a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></code> - for other failures</dd> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="http://docs.oracle.com/javase/6/docs/api/./javax/activation/DataHandler.html?is-external=true#writeTo-java.io.OutputStream-" title="class or interface in javax.activation"><code>DataHandler.writeTo(java.io.OutputStream)</code></a></dd> </dl> </li> </ul> <a name="getHeader-java.lang.String-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getHeader</h4> <pre>public <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[] getHeader(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name) throws <a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></pre> <div class="block">Get all the headers for this header_name. Note that certain headers may be encoded as per RFC 2047 if they contain non US-ASCII characters and these should be decoded.</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../javax/mail/Part.html#getHeader-java.lang.String-">getHeader</a></code> in interface <code><a href="../../../javax/mail/Part.html" title="interface in javax.mail">Part</a></code></dd> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>name</code> - name of header</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>array of headers</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></code> - for failures</dd> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javax/mail/internet/MimeUtility.html" title="class in javax.mail.internet"><code>MimeUtility</code></a></dd> </dl> </li> </ul> <a name="getHeader-java.lang.String-java.lang.String-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getHeader</h4> <pre>public <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> getHeader(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> delimiter) throws <a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></pre> <div class="block">Get all the headers for this header name, returned as a single String, with headers separated by the delimiter. If the delimiter is <code>null</code>, only the first header is returned.</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../javax/mail/internet/MimePart.html#getHeader-java.lang.String-java.lang.String-">getHeader</a></code> in interface <code><a href="../../../javax/mail/internet/MimePart.html" title="interface in javax.mail.internet">MimePart</a></code></dd> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>name</code> - the name of this header</dd> <dd><code>delimiter</code> - delimiter between fields in returned string</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>the value fields for all headers with this name</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></code> - for failures</dd> </dl> </li> </ul> <a name="setHeader-java.lang.String-java.lang.String-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>setHeader</h4> <pre>public void setHeader(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> value) throws <a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></pre> <div class="block">Set the value for this header_name. Replaces all existing header values with this new value. Note that RFC 822 headers must contain only US-ASCII characters, so a header that contains non US-ASCII characters must be encoded as per the rules of RFC 2047.</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../javax/mail/Part.html#setHeader-java.lang.String-java.lang.String-">setHeader</a></code> in interface <code><a href="../../../javax/mail/Part.html" title="interface in javax.mail">Part</a></code></dd> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>name</code> - header name</dd> <dd><code>value</code> - header value</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../../../javax/mail/IllegalWriteException.html" title="class in javax.mail">IllegalWriteException</a></code> - if the underlying implementation does not support modification of existing values</dd> <dd><code><a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></code> - for other failures</dd> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javax/mail/internet/MimeUtility.html" title="class in javax.mail.internet"><code>MimeUtility</code></a></dd> </dl> </li> </ul> <a name="addHeader-java.lang.String-java.lang.String-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>addHeader</h4> <pre>public void addHeader(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name, <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> value) throws <a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></pre> <div class="block">Add this value to the existing values for this header_name. Note that RFC 822 headers must contain only US-ASCII characters, so a header that contains non US-ASCII characters must be encoded as per the rules of RFC 2047.</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../javax/mail/Part.html#addHeader-java.lang.String-java.lang.String-">addHeader</a></code> in interface <code><a href="../../../javax/mail/Part.html" title="interface in javax.mail">Part</a></code></dd> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>name</code> - header name</dd> <dd><code>value</code> - header value</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../../../javax/mail/IllegalWriteException.html" title="class in javax.mail">IllegalWriteException</a></code> - if the underlying implementation does not support modification of existing values</dd> <dd><code><a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></code> - for other failures</dd> <dt><span class="seeLabel">See Also:</span></dt> <dd><a href="../../../javax/mail/internet/MimeUtility.html" title="class in javax.mail.internet"><code>MimeUtility</code></a></dd> </dl> </li> </ul> <a name="removeHeader-java.lang.String-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>removeHeader</h4> <pre>public void removeHeader(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> name) throws <a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></pre> <div class="block">Remove all headers with this name.</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../javax/mail/Part.html#removeHeader-java.lang.String-">removeHeader</a></code> in interface <code><a href="../../../javax/mail/Part.html" title="interface in javax.mail">Part</a></code></dd> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>name</code> - the name of this header</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../../../javax/mail/IllegalWriteException.html" title="class in javax.mail">IllegalWriteException</a></code> - if the underlying implementation does not support modification of existing values</dd> <dd><code><a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></code> - for other failures</dd> </dl> </li> </ul> <a name="getAllHeaders--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getAllHeaders</h4> <pre>public <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/util/Enumeration.html?is-external=true" title="class or interface in java.util">Enumeration</a><<a href="../../../javax/mail/Header.html" title="class in javax.mail">Header</a>> getAllHeaders() throws <a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></pre> <div class="block">Return all the headers from this Message as an Enumeration of Header objects.</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../javax/mail/Part.html#getAllHeaders--">getAllHeaders</a></code> in interface <code><a href="../../../javax/mail/Part.html" title="interface in javax.mail">Part</a></code></dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>enumeration of Header objects</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></code> - for failures</dd> </dl> </li> </ul> <a name="getMatchingHeaders-java.lang.String:A-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getMatchingHeaders</h4> <pre>public <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/util/Enumeration.html?is-external=true" title="class or interface in java.util">Enumeration</a><<a href="../../../javax/mail/Header.html" title="class in javax.mail">Header</a>> getMatchingHeaders(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[] names) throws <a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></pre> <div class="block">Return matching headers from this Message as an Enumeration of Header objects.</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../javax/mail/Part.html#getMatchingHeaders-java.lang.String:A-">getMatchingHeaders</a></code> in interface <code><a href="../../../javax/mail/Part.html" title="interface in javax.mail">Part</a></code></dd> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>names</code> - the headers to match</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>enumeration of Header objects</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></code> - for failures</dd> </dl> </li> </ul> <a name="getNonMatchingHeaders-java.lang.String:A-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getNonMatchingHeaders</h4> <pre>public <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/util/Enumeration.html?is-external=true" title="class or interface in java.util">Enumeration</a><<a href="../../../javax/mail/Header.html" title="class in javax.mail">Header</a>> getNonMatchingHeaders(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[] names) throws <a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></pre> <div class="block">Return non-matching headers from this Message as an Enumeration of Header objects.</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../javax/mail/Part.html#getNonMatchingHeaders-java.lang.String:A-">getNonMatchingHeaders</a></code> in interface <code><a href="../../../javax/mail/Part.html" title="interface in javax.mail">Part</a></code></dd> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>names</code> - the headers to not match</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>enumeration of Header objects</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></code> - for failures</dd> </dl> </li> </ul> <a name="addHeaderLine-java.lang.String-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>addHeaderLine</h4> <pre>public void addHeaderLine(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a> line) throws <a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></pre> <div class="block">Add a header line to this body part</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../javax/mail/internet/MimePart.html#addHeaderLine-java.lang.String-">addHeaderLine</a></code> in interface <code><a href="../../../javax/mail/internet/MimePart.html" title="interface in javax.mail.internet">MimePart</a></code></dd> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>line</code> - the line to add</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../../../javax/mail/IllegalWriteException.html" title="class in javax.mail">IllegalWriteException</a></code> - if the underlying implementation does not support modification</dd> <dd><code><a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></code> - for other failures</dd> </dl> </li> </ul> <a name="getAllHeaderLines--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getAllHeaderLines</h4> <pre>public <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/util/Enumeration.html?is-external=true" title="class or interface in java.util">Enumeration</a><<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>> getAllHeaderLines() throws <a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></pre> <div class="block">Get all header lines as an Enumeration of Strings. A Header line is a raw RFC 822 header line, containing both the "name" and "value" field.</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../javax/mail/internet/MimePart.html#getAllHeaderLines--">getAllHeaderLines</a></code> in interface <code><a href="../../../javax/mail/internet/MimePart.html" title="interface in javax.mail.internet">MimePart</a></code></dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>an Enumeration of Strings</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></code> - for failures</dd> </dl> </li> </ul> <a name="getMatchingHeaderLines-java.lang.String:A-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getMatchingHeaderLines</h4> <pre>public <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/util/Enumeration.html?is-external=true" title="class or interface in java.util">Enumeration</a><<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>> getMatchingHeaderLines(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[] names) throws <a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></pre> <div class="block">Get matching header lines as an Enumeration of Strings. A Header line is a raw RFC 822 header line, containing both the "name" and "value" field.</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../javax/mail/internet/MimePart.html#getMatchingHeaderLines-java.lang.String:A-">getMatchingHeaderLines</a></code> in interface <code><a href="../../../javax/mail/internet/MimePart.html" title="interface in javax.mail.internet">MimePart</a></code></dd> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>names</code> - the headers to return</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>an Enumeration of Strings</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></code> - for failures</dd> </dl> </li> </ul> <a name="getNonMatchingHeaderLines-java.lang.String:A-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>getNonMatchingHeaderLines</h4> <pre>public <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/util/Enumeration.html?is-external=true" title="class or interface in java.util">Enumeration</a><<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>> getNonMatchingHeaderLines(<a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[] names) throws <a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></pre> <div class="block">Get non-matching header lines as an Enumeration of Strings. A Header line is a raw RFC 822 header line, containing both the "name" and "value" field.</div> <dl> <dt><span class="overrideSpecifyLabel">Specified by:</span></dt> <dd><code><a href="../../../javax/mail/internet/MimePart.html#getNonMatchingHeaderLines-java.lang.String:A-">getNonMatchingHeaderLines</a></code> in interface <code><a href="../../../javax/mail/internet/MimePart.html" title="interface in javax.mail.internet">MimePart</a></code></dd> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>names</code> - the headers to not return</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>an Enumeration of Strings</dd> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></code> - for failures</dd> </dl> </li> </ul> <a name="updateHeaders--"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>updateHeaders</h4> <pre>protected void updateHeaders() throws <a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></pre> <div class="block">Examine the content of this body part and update the appropriate MIME headers. Typical headers that get set here are <code>Content-Type</code> and <code>Content-Transfer-Encoding</code>. Headers might need to be updated in two cases: <br> - A message being crafted by a mail application will certainly need to activate this method at some point to fill up its internal headers. <br> - A message read in from a Store will have obtained all its headers from the store, and so doesn't need this. However, if this message is editable and if any edits have been made to either the content or message structure, we might need to resync our headers. <br> In both cases this method is typically called by the <code>Message.saveChanges</code> method. <p> If the <a href="../../../javax/mail/internet/MimeBodyPart.html#cachedContent"><code>cachedContent</code></a> field is not null (that is, it references a Multipart or Message object), then that object is used to set a new DataHandler, any stream data used to create this object is discarded, and the <a href="../../../javax/mail/internet/MimeBodyPart.html#cachedContent"><code>cachedContent</code></a> field is cleared.</div> <dl> <dt><span class="throwsLabel">Throws:</span></dt> <dd><code><a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></code> - for failures</dd> </dl> </li> </ul> </li> </ul> </li> </ul> </div> </div> <!-- ========= END OF CLASS DATA ========= --> <!-- ======= START OF BOTTOM NAVBAR ====== --> <div class="bottomNav"><a name="navbar.bottom"> <!-- --> </a> <div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div> <a name="navbar.bottom.firstrow"> <!-- --> </a> <ul class="navList" title="Navigation"> <li><a href="../../../overview-summary.html">Overview</a></li> <li><a href="package-summary.html">Package</a></li> <li class="navBarCell1Rev">Class</li> <li><a href="class-use/MimeBodyPart.html">Use</a></li> <li><a href="package-tree.html">Tree</a></li> <li><a href="../../../deprecated-list.html">Deprecated</a></li> <li><a href="../../../index-files/index-1.html">Index</a></li> <li><a href="../../../help-doc.html">Help</a></li> </ul> </div> <div class="subNav"> <ul class="navList"> <li><a href="../../../javax/mail/internet/MailDateFormat.html" title="class in javax.mail.internet"><span class="typeNameLink">Prev Class</span></a></li> <li><a href="../../../javax/mail/internet/MimeMessage.html" title="class in javax.mail.internet"><span class="typeNameLink">Next Class</span></a></li> </ul> <ul class="navList"> <li><a href="../../../index.html?javax/mail/internet/MimeBodyPart.html" target="_top">Frames</a></li> <li><a href="MimeBodyPart.html" target="_top">No Frames</a></li> </ul> <ul class="navList" id="allclasses_navbar_bottom"> <li><a href="../../../allclasses-noframe.html">All Classes</a></li> </ul> <div> <script type="text/javascript"><!-- allClassesLink = document.getElementById("allclasses_navbar_bottom"); if(window==top) { allClassesLink.style.display = "block"; } else { allClassesLink.style.display = "none"; } //--> </script> </div> <div> <ul class="subNavList"> <li>Summary: </li> <li>Nested | </li> <li><a href="#field.summary">Field</a> | </li> <li><a href="#constructor.summary">Constr</a> | </li> <li><a href="#method.summary">Method</a></li> </ul> <ul class="subNavList"> <li>Detail: </li> <li><a href="#field.detail">Field</a> | </li> <li><a href="#constructor.detail">Constr</a> | </li> <li><a href="#method.detail">Method</a></li> </ul> </div> <a name="skip.navbar.bottom"> <!-- --> </a></div> <!-- ======== END OF BOTTOM NAVBAR ======= --> <p class="legalCopy"><small>Copyright © 1996-2017, <a href="http://www.oracle.com">Oracle</a> and/or its affiliates. All Rights Reserved. Use is subject to <a href="../../../doc-files/speclicense.html" target="_top">license terms</a>.</small></p> </body> </html>