📄 internetheaders.html
字号:
<A NAME="InternetHeaders()"><!-- --></A><H3>InternetHeaders</H3><PRE>public <B>InternetHeaders</B>()</PRE><DL><DD>Create an empty InternetHeaders object.<P></DL><HR><A NAME="InternetHeaders(java.io.InputStream)"><!-- --></A><H3>InternetHeaders</H3><PRE>public <B>InternetHeaders</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/InputStream.html" 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><DL><DD>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><DT><B>Parameters:</B><DD><CODE>is</CODE> - RFC822 input stream</DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Method Detail</B></FONT></TD></TR></TABLE><A NAME="load(java.io.InputStream)"><!-- --></A><H3>load</H3><PRE>public void <B>load</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/InputStream.html" 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><DL><DD>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. <p> Note that the header lines are added into this InternetHeaders object, so any existing headers in this object will not be affected.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>is</CODE> - RFC822 input stream<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></CODE></DL></DD></DL><HR><A NAME="getHeader(java.lang.String)"><!-- --></A><H3>getHeader</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>[] <B>getHeader</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> name)</PRE><DL><DD>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.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - header name<DT><B>Returns:</B><DD>array of header values, or null if none</DL></DD></DL><HR><A NAME="getHeader(java.lang.String, java.lang.String)"><!-- --></A><H3>getHeader</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> <B>getHeader</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> name, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> delimiter)</PRE><DL><DD>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.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - header name<DD><CODE>delimiter</CODE> - delimiter<DT><B>Returns:</B><DD>the value fields for all headers with this name, or null if none</DL></DD></DL><HR><A NAME="setHeader(java.lang.String, java.lang.String)"><!-- --></A><H3>setHeader</H3><PRE>public void <B>setHeader</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> name, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> value)</PRE><DL><DD>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<P><DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - header name<DD><CODE>value</CODE> - header value</DL></DD></DL><HR><A NAME="addHeader(java.lang.String, java.lang.String)"><!-- --></A><H3>addHeader</H3><PRE>public void <B>addHeader</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> name, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> value)</PRE><DL><DD>Add a header with the specified name and value to the header list. <p> Note that RFC822 headers can only contain US-ASCII characters.<P><DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - header name<DD><CODE>value</CODE> - header value</DL></DD></DL><HR><A NAME="removeHeader(java.lang.String)"><!-- --></A><H3>removeHeader</H3><PRE>public void <B>removeHeader</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> name)</PRE><DL><DD>Remove all header entries that match the given name<P><DD><DL><DT><B>Parameters:</B><DD><CODE>name</CODE> - header name</DL></DD></DL><HR><A NAME="getAllHeaders()"><!-- --></A><H3>getAllHeaders</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/Enumeration.html" title="class or interface in java.util">Enumeration</A> <B>getAllHeaders</B>()</PRE><DL><DD>Return all the headers as an Enumeration of <A HREF="../../../javax/mail/Header.html" title="class in javax.mail"><CODE>Header</CODE></A> objects.<P><DD><DL><DT><B>Returns:</B><DD>Header objects</DL></DD></DL><HR><A NAME="getMatchingHeaders(java.lang.String[])"><!-- --></A><H3>getMatchingHeaders</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/Enumeration.html" title="class or interface in java.util">Enumeration</A> <B>getMatchingHeaders</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>[] names)</PRE><DL><DD>Return all matching <A HREF="../../../javax/mail/Header.html" title="class in javax.mail"><CODE>Header</CODE></A> objects.<P><DD><DL><DT><B>Returns:</B><DD>matching Header objects</DL></DD></DL><HR><A NAME="getNonMatchingHeaders(java.lang.String[])"><!-- --></A><H3>getNonMatchingHeaders</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/Enumeration.html" title="class or interface in java.util">Enumeration</A> <B>getNonMatchingHeaders</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>[] names)</PRE><DL><DD>Return all non-matching <A HREF="../../../javax/mail/Header.html" title="class in javax.mail"><CODE>Header</CODE></A> objects.<P><DD><DL><DT><B>Returns:</B><DD>non-matching Header objects</DL></DD></DL><HR><A NAME="addHeaderLine(java.lang.String)"><!-- --></A><H3>addHeaderLine</H3><PRE>public void <B>addHeaderLine</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> line)</PRE><DL><DD>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. <p> Note that RFC822 headers can only contain US-ASCII characters<P><DD><DL><DT><B>Parameters:</B><DD><CODE>line</CODE> - raw RFC822 header line</DL></DD></DL><HR><A NAME="getAllHeaderLines()"><!-- --></A><H3>getAllHeaderLines</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/Enumeration.html" title="class or interface in java.util">Enumeration</A> <B>getAllHeaderLines</B>()</PRE><DL><DD>Return all the header lines as an Enumeration of Strings.<P><DD><DL></DL></DD></DL><HR><A NAME="getMatchingHeaderLines(java.lang.String[])"><!-- --></A><H3>getMatchingHeaderLines</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/Enumeration.html" title="class or interface in java.util">Enumeration</A> <B>getMatchingHeaderLines</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>[] names)</PRE><DL><DD>Return all matching header lines as an Enumeration of Strings.<P><DD><DL></DL></DD></DL><HR><A NAME="getNonMatchingHeaderLines(java.lang.String[])"><!-- --></A><H3>getNonMatchingHeaderLines</H3><PRE>public <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/Enumeration.html" title="class or interface in java.util">Enumeration</A> <B>getNonMatchingHeaderLines</B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>[] names)</PRE><DL><DD>Return all non-matching header lines<P><DD><DL></DL></DD></DL><!-- ========= END OF CLASS DATA ========= --><HR><!-- ======= START OF BOTTOM NAVBAR ====== --><A NAME="navbar_bottom"><!-- --></A><A HREF="#skip-navbar_bottom" title="Skip navigation links"></A><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""><TR><TD COLSPAN=3 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"><A NAME="navbar_bottom_firstrow"><!-- --></A><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../overview-summary.html"><FONT CLASS="NavBarFont1"><B>Overview</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../index-all.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR></TABLE></TD><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM><b>Java<sup><font size=-2>TM</font></sup> 2 Platform<br>Ent. Ed. v1.4</b></EM></TD></TR><TR><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../javax/mail/internet/InternetAddress.html" title="class in javax.mail.internet"><B>PREV CLASS</B></A> <A HREF="../../../javax/mail/internet/MailDateFormat.html" title="class in javax.mail.internet"><B>NEXT CLASS</B></A></FONT></TD><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../index.html" target="_top"><B>FRAMES</B></A> <A HREF="InternetHeaders.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--></SCRIPT><NOSCRIPT> <A HREF="../../../allclasses-noframe.html"><B>All Classes</B></A></NOSCRIPT></FONT></TD></TR><TR><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | FIELD | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2">DETAIL: FIELD | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD></TR></TABLE><A NAME="skip-navbar_bottom"></A><!-- ======== END OF BOTTOM NAVBAR ======= --><HR><font size="-1"><a href="http://java.sun.com/webapps/bugreport">Submit a bug or feature</a> <p>Copyright 2003 Sun Microsystems, Inc. All rights reserved.</font></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -