<!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>InternetHeaders (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="InternetHeaders (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}; 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/InternetHeaders.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/InternetAddress.html" title="class in javax.mail.internet"><span class="typeNameLink">Prev Class</span></a></li> <li><a href="../../../javax/mail/internet/InternetHeaders.InternetHeader.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/InternetHeaders.html" target="_top">Frames</a></li> <li><a href="InternetHeaders.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><a href="#nested.class.summary">Nested</a> | </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 InternetHeaders" class="title">Class InternetHeaders</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>javax.mail.internet.InternetHeaders</li> </ul> </li> </ul> <div class="description"> <ul class="blockList"> <li class="blockList"> <hr> <br> <pre>public class <span class="typeNameLabel">InternetHeaders</span> extends <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></pre> <div class="block">InternetHeaders is a utility class that manages RFC822 style headers. Given an RFC822 format message stream, it reads lines until the blank line that indicates end of header. The input stream is positioned at the start of the body. The lines are stored within the object and can be extracted as either Strings or <a href="../../../javax/mail/Header.html" title="class in javax.mail"><code>Header</code></a> objects. <p> This class is mostly intended for service providers. MimeMessage and MimeBody use this class for holding their headers. <hr> <strong>A note on RFC822 and MIME headers</strong><p> RFC822 and MIME header fields <strong>must</strong> contain only US-ASCII characters. If a header contains non US-ASCII characters, it must be encoded as per the rules in RFC 2047. 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> The current implementation supports the System property <code>mail.mime.ignorewhitespacelines</code>, which if set to true will cause a line containing only whitespace to be considered a blank line terminating the header.</div> <dl> <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> </div> <div class="summary"> <ul class="blockList"> <li class="blockList"> <!-- ======== NESTED CLASS SUMMARY ======== --> <ul class="blockList"> <li class="blockList"><a name="nested.class.summary"> <!-- --> </a> <h3>Nested Class Summary</h3> <table class="memberSummary" border="0" cellpadding="3" cellspacing="0" summary="Nested Class Summary table, listing nested classes, and an explanation"> <caption><span>Nested Classes</span><span class="tabEnd"> </span></caption> <tr> <th class="colFirst" scope="col">Modifier and Type</th> <th class="colLast" scope="col">Class and Description</th> </tr> <tr class="altColor"> <td class="colFirst"><code>protected static class </code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/InternetHeaders.InternetHeader.html" title="class in javax.mail.internet">InternetHeaders.InternetHeader</a></span></code> <div class="block">An individual internet header.</div> </td> </tr> </table> </li> </ul> <!-- =========== 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/util/List.html?is-external=true" title="class or interface in java.util">List</a><<a href="../../../javax/mail/internet/InternetHeaders.InternetHeader.html" title="class in javax.mail.internet">InternetHeaders.InternetHeader</a>></code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/InternetHeaders.html#headers">headers</a></span></code> <div class="block">The actual list of Headers, including placeholder entries.</div> </td> </tr> </table> </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/InternetHeaders.html#InternetHeaders--">InternetHeaders</a></span>()</code> <div class="block">Create an empty InternetHeaders object.</div> </td> </tr> <tr class="rowColor"> <td class="colOne"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/InternetHeaders.html#InternetHeaders-java.io.InputStream-">InternetHeaders</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">Read and parse the given RFC822 message stream till the blank line separating the header from the body.</div> </td> </tr> <tr class="altColor"> <td class="colOne"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/InternetHeaders.html#InternetHeaders-java.io.InputStream-boolean-">InternetHeaders</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, boolean allowutf8)</code> <div class="block">Read and parse the given RFC822 message stream till the blank line separating the header from the body.</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/InternetHeaders.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 a header with the specified name and value to the header list.</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/InternetHeaders.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 an RFC822 header line to the header store.</div> </td> </tr> <tr id="i2" 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/InternetHeaders.html#getAllHeaderLines--">getAllHeaderLines</a></span>()</code> <div class="block">Return all the header lines as an Enumeration of Strings.</div> </td> </tr> <tr id="i3" 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/InternetHeaders.html#getAllHeaders--">getAllHeaders</a></span>()</code> <div class="block">Return all the headers as an Enumeration of <a href="../../../javax/mail/Header.html" title="class in javax.mail"><code>Header</code></a> objects.</div> </td> </tr> <tr id="i4" 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/InternetHeaders.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">Return all the values for the specified header.</div> </td> </tr> <tr id="i5" 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/InternetHeaders.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="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/InternetHeaders.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">Return all matching 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/InternetHeaders.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 all matching <a href="../../../javax/mail/Header.html" title="class in javax.mail"><code>Header</code></a> 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/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/InternetHeaders.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">Return all non-matching header lines</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/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/InternetHeaders.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 all non-matching <a href="../../../javax/mail/Header.html" title="class in javax.mail"><code>Header</code></a> objects.</div> </td> </tr> <tr id="i10" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/InternetHeaders.html#load-java.io.InputStream-">load</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">Read and parse the given RFC822 message stream till the blank line separating the header from the body.</div> </td> </tr> <tr id="i11" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/InternetHeaders.html#load-java.io.InputStream-boolean-">load</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, boolean allowutf8)</code> <div class="block">Read and parse the given RFC822 message stream till the blank line separating the header from the body.</div> </td> </tr> <tr id="i12" class="altColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/InternetHeaders.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 header entries that match the given name</div> </td> </tr> <tr id="i13" class="rowColor"> <td class="colFirst"><code>void</code></td> <td class="colLast"><code><span class="memberNameLink"><a href="../../../javax/mail/internet/InternetHeaders.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">Change the first header line that matches name to have value, adding a new header if no existing header matches.</div> </td> </tr> </table> <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="headers"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>headers</h4> <pre>protected <a href="http://docs.oracle.com/javase/1.5.0/docs/api/./java/util/List.html?is-external=true" title="class or interface in java.util">List</a><<a href="../../../javax/mail/internet/InternetHeaders.InternetHeader.html" title="class in javax.mail.internet">InternetHeaders.InternetHeader</a>> headers</pre> <div class="block">The actual list of Headers, including placeholder entries. Placeholder entries are Headers with a null value and are never seen by clients of the InternetHeaders class. Placeholder entries are used to keep track of the preferred order of headers. Headers are never actually removed from the list, they're converted into placeholder entries. New headers are added after existing headers of the same name (or before in the case of <code>Received</code> and <code>Return-Path</code> headers). If no existing header or placeholder for the header is found, new headers are added after the special placeholder with the name ":".</div> <dl> <dt><span class="simpleTagLabel">Since:</span></dt> <dd>JavaMail 1.4</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="InternetHeaders--"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>InternetHeaders</h4> <pre>public InternetHeaders()</pre> <div class="block">Create an empty InternetHeaders object. Placeholder entries are inserted to indicate the preferred order of headers.</div> </li> </ul> <a name="InternetHeaders-java.io.InputStream-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>InternetHeaders</h4> <pre>public InternetHeaders(<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">Read and parse the given RFC822 message stream till the blank line separating the header from the body. The input stream is left positioned at the start of the body. The header lines are stored internally. <p> For efficiency, wrap a BufferedInputStream around the actual input stream and pass it as the parameter. <p> No placeholder entries are inserted; the original order of the headers is preserved.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>is</code> - RFC822 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 any I/O error reading the stream</dd> </dl> </li> </ul> <a name="InternetHeaders-java.io.InputStream-boolean-"> <!-- --> </a> <ul class="blockListLast"> <li class="blockList"> <h4>InternetHeaders</h4> <pre>public InternetHeaders(<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, boolean allowutf8) throws <a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></pre> <div class="block">Read and parse the given RFC822 message stream till the blank line separating the header from the body. The input stream is left positioned at the start of the body. The header lines are stored internally. <p> For efficiency, wrap a BufferedInputStream around the actual input stream and pass it as the parameter. <p> No placeholder entries are inserted; the original order of the headers is preserved.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>is</code> - RFC822 input stream</dd> <dd><code>allowutf8</code> - if UTF-8 encoded headers are allowed</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 any I/O error reading the stream</dd> <dt><span class="simpleTagLabel">Since:</span></dt> <dd>JavaMail 1.6</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="load-java.io.InputStream-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>load</h4> <pre>public void load(<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">Read and parse the given RFC822 message stream till the blank line separating the header from the body. Store the header lines inside this InternetHeaders object. The order of header lines is preserved. <p> Note that the header lines are added into this InternetHeaders object, so any existing headers in this object will not be affected. Headers are added to the end of the existing list of headers, in order.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>is</code> - RFC822 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 any I/O error reading the stream</dd> </dl> </li> </ul> <a name="load-java.io.InputStream-boolean-"> <!-- --> </a> <ul class="blockList"> <li class="blockList"> <h4>load</h4> <pre>public void load(<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, boolean allowutf8) throws <a href="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</a></pre> <div class="block">Read and parse the given RFC822 message stream till the blank line separating the header from the body. Store the header lines inside this InternetHeaders object. The order of header lines is preserved. <p> Note that the header lines are added into this InternetHeaders object, so any existing headers in this object will not be affected. Headers are added to the end of the existing list of headers, in order.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>is</code> - RFC822 input stream</dd> <dd><code>allowutf8</code> - if UTF-8 encoded headers are allowed</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 any I/O error reading the stream</dd> <dt><span class="simpleTagLabel">Since:</span></dt> <dd>JavaMail 1.6</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)</pre> <div class="block">Return all the values for the specified header. The values are String objects. Returns <code>null</code> if no headers with the specified name exist.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>name</code> - header name</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>array of header values, or null if none</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)</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. Returns <code>null</code> if no headers with the specified name exist.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>name</code> - header name</dd> <dd><code>delimiter</code> - delimiter</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>the value fields for all headers with this name, or null if none</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)</pre> <div class="block">Change the first header line that matches name to have value, adding a new header if no existing header matches. Remove all matching headers but the first. <p> Note that RFC822 headers can only contain US-ASCII characters</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>name</code> - header name</dd> <dd><code>value</code> - header value</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)</pre> <div class="block">Add a header with the specified name and value to the header list. <p> The current implementation knows about the preferred order of most well-known headers and will insert headers in that order. In addition, it knows that <code>Received</code> headers should be inserted in reverse order (newest before oldest), and that they should appear at the beginning of the headers, preceeded only by a possible <code>Return-Path</code> header. <p> Note that RFC822 headers can only contain US-ASCII characters.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>name</code> - header name</dd> <dd><code>value</code> - header value</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)</pre> <div class="block">Remove all header entries that match the given name</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>name</code> - header name</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()</pre> <div class="block">Return all the headers as an Enumeration of <a href="../../../javax/mail/Header.html" title="class in javax.mail"><code>Header</code></a> objects.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>Enumeration of Header objects</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)</pre> <div class="block">Return all matching <a href="../../../javax/mail/Header.html" title="class in javax.mail"><code>Header</code></a> objects.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>names</code> - the headers to return</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>Enumeration of matching Header objects</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)</pre> <div class="block">Return all non-matching <a href="../../../javax/mail/Header.html" title="class in javax.mail"><code>Header</code></a> objects.</div> <dl> <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>Enumeration of non-matching Header objects</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)</pre> <div class="block">Add an RFC822 header line to the header store. If the line starts with a space or tab (a continuation line), add it to the last header line in the list. Otherwise, append the new header line to the list. <p> Note that RFC822 headers can only contain US-ASCII characters</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>line</code> - raw RFC822 header line</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()</pre> <div class="block">Return all the header lines as an Enumeration of Strings.</div> <dl> <dt><span class="returnLabel">Returns:</span></dt> <dd>Enumeration of Strings of all header lines</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)</pre> <div class="block">Return all matching header lines as an Enumeration of Strings.</div> <dl> <dt><span class="paramLabel">Parameters:</span></dt> <dd><code>names</code> - the headers to return</dd> <dt><span class="returnLabel">Returns:</span></dt> <dd>Enumeration of Strings of all matching header lines</dd> </dl> </li> </ul> <a name="getNonMatchingHeaderLines-java.lang.String:A-"> <!-- --> </a> <ul class="blockListLast"> <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)</pre> <div class="block">Return all non-matching header lines</div> <dl> <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>Enumeration of Strings of all non-matching header lines</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/InternetHeaders.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/InternetAddress.html" title="class in javax.mail.internet"><span class="typeNameLink">Prev Class</span></a></li> <li><a href="../../../javax/mail/internet/InternetHeaders.InternetHeader.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/InternetHeaders.html" target="_top">Frames</a></li> <li><a href="InternetHeaders.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><a href="#nested.class.summary">Nested</a> | </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>