mimebodypart.html

来自「SUN的JAVA MAIL API」· HTML 代码 · 共 1,410 行 · 第 1/5 页

HTML
1,410
字号
<DT><B>Specified by: </B><DD><A HREF="../../../javax/mail/internet/MimePart.html#setText(java.lang.String, java.lang.String)">setText</A> in interface <A HREF="../../../javax/mail/internet/MimePart.html">MimePart</A></DL>
</DD>
</DL>
<HR>

<A NAME="setContent(javax.mail.Multipart)"><!-- --></A><H3>
setContent</H3>
<PRE>
public void <B>setContent</B>(<A HREF="../../../javax/mail/Multipart.html">Multipart</A>&nbsp;mp)
                throws <A HREF="../../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>This method sets the body part's content to a Multipart object.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>mp</CODE> - The multipart object that is the Message's content<DT><B>Throws:</B><DD><A HREF="../../../javax/mail/IllegalWriteException.html">IllegalWriteException</A> - if the underlying
			implementation does not support modification of
			existing values.<DD>IllegalStateException - if this body part is
			obtained from a READ_ONLY folder.</DL>
</DD>
</DL>
<HR>

<A NAME="writeTo(java.io.OutputStream)"><!-- --></A><H3>
writeTo</H3>
<PRE>
public void <B>writeTo</B>(java.io.OutputStream&nbsp;os)
             throws java.io.IOException,
                    <A HREF="../../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>Output the body part as an RFC 822 format stream.<DD><DL>
<DT><B>Throws:</B><DD><A HREF="../../../javax/mail/MessagingException.html">MessagingException</A> - &nbsp;<DD>java.io.IOException - if an error occurs writing to the
				stream or if an error is generated
				by the javax.activation layer.<DT><B>See Also: </B><DD><CODE>DataHandler.writeTo(java.io.OutputStream)</CODE></DL>
</DD>
</DL>
<HR>

<A NAME="getHeader(java.lang.String)"><!-- --></A><H3>
getHeader</H3>
<PRE>
public java.lang.String[] <B>getHeader</B>(java.lang.String&nbsp;name)
                             throws <A HREF="../../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>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.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>name</CODE> - name of header<DT><B>Returns:</B><DD>array of headers<DT><B>See Also: </B><DD><A HREF="../../../javax/mail/internet/MimeUtility.html"><CODE>MimeUtility</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="getHeader(java.lang.String, java.lang.String)"><!-- --></A><H3>
getHeader</H3>
<PRE>
public java.lang.String <B>getHeader</B>(java.lang.String&nbsp;name,
                                  java.lang.String&nbsp;delimiter)
                           throws <A HREF="../../../javax/mail/MessagingException.html">MessagingException</A></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.<DD><DL>
<DT><B>Specified by: </B><DD><A HREF="../../../javax/mail/internet/MimePart.html#getHeader(java.lang.String, java.lang.String)">getHeader</A> in interface <A HREF="../../../javax/mail/internet/MimePart.html">MimePart</A><DT><B>Parameters:</B><DD><CODE>header_name</CODE> - the name of this header<DT><B>Returns:</B><DD>the value fields for all headers with 
				this name<DT><B>Throws:</B><DD><A HREF="../../../javax/mail/MessagingException.html">MessagingException</A> - &nbsp;</DL>
</DD>
</DL>
<HR>

<A NAME="setHeader(java.lang.String, java.lang.String)"><!-- --></A><H3>
setHeader</H3>
<PRE>
public void <B>setHeader</B>(java.lang.String&nbsp;name,
                      java.lang.String&nbsp;value)
               throws <A HREF="../../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>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.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>name</CODE> - header name<DD><CODE>value</CODE> - header value<DT><B>See Also: </B><DD><A HREF="../../../javax/mail/internet/MimeUtility.html"><CODE>MimeUtility</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="addHeader(java.lang.String, java.lang.String)"><!-- --></A><H3>
addHeader</H3>
<PRE>
public void <B>addHeader</B>(java.lang.String&nbsp;name,
                      java.lang.String&nbsp;value)
               throws <A HREF="../../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>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.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>name</CODE> - header name<DD><CODE>value</CODE> - header value<DT><B>See Also: </B><DD><A HREF="../../../javax/mail/internet/MimeUtility.html"><CODE>MimeUtility</CODE></A></DL>
</DD>
</DL>
<HR>

<A NAME="removeHeader(java.lang.String)"><!-- --></A><H3>
removeHeader</H3>
<PRE>
public void <B>removeHeader</B>(java.lang.String&nbsp;name)
                  throws <A HREF="../../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>Remove all headers with this name.<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="getAllHeaders()"><!-- --></A><H3>
getAllHeaders</H3>
<PRE>
public java.util.Enumeration <B>getAllHeaders</B>()
                                    throws <A HREF="../../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>Return all the headers from this Message as an Enumeration of
 Header objects.<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="getMatchingHeaders(java.lang.String[])"><!-- --></A><H3>
getMatchingHeaders</H3>
<PRE>
public java.util.Enumeration <B>getMatchingHeaders</B>(java.lang.String[]&nbsp;names)
                                         throws <A HREF="../../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>Return matching headers from this Message as an Enumeration of
 Header objects. <p><DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="getNonMatchingHeaders(java.lang.String[])"><!-- --></A><H3>
getNonMatchingHeaders</H3>
<PRE>
public java.util.Enumeration <B>getNonMatchingHeaders</B>(java.lang.String[]&nbsp;names)
                                            throws <A HREF="../../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>Return non-matching headers from this Message as an
 Enumeration of Header objects.<DD><DL>
</DL>
</DD>
</DL>
<HR>

<A NAME="addHeaderLine(java.lang.String)"><!-- --></A><H3>
addHeaderLine</H3>
<PRE>
public void <B>addHeaderLine</B>(java.lang.String&nbsp;line)
                   throws <A HREF="../../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>Add a header line to this body part<DD><DL>
<DT><B>Specified by: </B><DD><A HREF="../../../javax/mail/internet/MimePart.html#addHeaderLine(java.lang.String)">addHeaderLine</A> in interface <A HREF="../../../javax/mail/internet/MimePart.html">MimePart</A></DL>
</DD>
</DL>
<HR>

<A NAME="getAllHeaderLines()"><!-- --></A><H3>
getAllHeaderLines</H3>
<PRE>
public java.util.Enumeration <B>getAllHeaderLines</B>()
                                        throws <A HREF="../../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>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.<DD><DL>
<DT><B>Specified by: </B><DD><A HREF="../../../javax/mail/internet/MimePart.html#getAllHeaderLines()">getAllHeaderLines</A> in interface <A HREF="../../../javax/mail/internet/MimePart.html">MimePart</A></DL>
</DD>
</DL>
<HR>

<A NAME="getMatchingHeaderLines(java.lang.String[])"><!-- --></A><H3>
getMatchingHeaderLines</H3>
<PRE>
public java.util.Enumeration <B>getMatchingHeaderLines</B>(java.lang.String[]&nbsp;names)
                                             throws <A HREF="../../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>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.<DD><DL>
<DT><B>Specified by: </B><DD><A HREF="../../../javax/mail/internet/MimePart.html#getMatchingHeaderLines(java.lang.String[])">getMatchingHeaderLines</A> in interface <A HREF="../../../javax/mail/internet/MimePart.html">MimePart</A></DL>
</DD>
</DL>
<HR>

<A NAME="getNonMatchingHeaderLines(java.lang.String[])"><!-- --></A><H3>
getNonMatchingHeaderLines</H3>
<PRE>
public java.util.Enumeration <B>getNonMatchingHeaderLines</B>(java.lang.String[]&nbsp;names)
                                                throws <A HREF="../../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>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.<DD><DL>
<DT><B>Specified by: </B><DD><A HREF="../../../javax/mail/internet/MimePart.html#getNonMatchingHeaderLines(java.lang.String[])">getNonMatchingHeaderLines</A> in interface <A HREF="../../../javax/mail/internet/MimePart.html">MimePart</A></DL>
</DD>
</DL>
<HR>

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

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

<TR>
<TD BGCOLOR="white" ID="NavBarCell2"><FONT SIZE="-2">
&nbsp;<A HREF="../../../javax/mail/internet/InternetHeaders.html"><B>PREV CLASS</B></A>&nbsp;
&nbsp;<A HREF="../../../javax/mail/internet/MimeMessage.html"><B>NEXT CLASS</B></A></FONT></TD>
<TD BGCOLOR="white" ID="NavBarCell2"><FONT SIZE="-2">
  <A HREF="../../../index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;
&nbsp;<A HREF="MimeBodyPart.html" TARGET="_top"><B>NO FRAMES</B></A></FONT></TD>
</TR>
<TR>
<TD VALIGN="top" ID="NavBarCell3"><FONT SIZE="-2">
  SUMMARY: &nbsp;INNER&nbsp;|&nbsp;<A HREF="#field_summary">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_summary">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_summary">METHOD</A></FONT></TD>
<TD VALIGN="top" ID="NavBarCell3"><FONT SIZE="-2">
DETAIL: &nbsp;<A HREF="#field_detail">FIELD</A>&nbsp;|&nbsp;<A HREF="#constructor_detail">CONSTR</A>&nbsp;|&nbsp;<A HREF="#method_detail">METHOD</A></FONT></TD>
</TR>
</TABLE>
<!-- =========== END OF NAVBAR =========== -->

<HR>

</BODY>
</HTML>

⌨️ 快捷键说明

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