mimebodypart.html
来自「SUN公司官方J2EE中文帮助文档 应该不错 有兴趣的下来看看 html格式的」· HTML 代码 · 共 1,360 行 · 第 1/5 页
HTML
1,360 行
<TD><CODE><B><A HREF="../../../javax/mail/internet/MimeBodyPart.html#updateHeaders()">updateHeaders</A></B>()</CODE>
<BR>
Examine the content of this body part and update the appropriate
MIME headers.</TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">
<CODE> void</CODE></FONT></TD>
<TD><CODE><B><A HREF="../../../javax/mail/internet/MimeBodyPart.html#writeTo(java.io.OutputStream)">writeTo</A></B>(java.io.OutputStream os)</CODE>
<BR>
Output the body part as an RFC 822 format stream.</TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_javax.mail.BodyPart"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from class javax.mail.<A HREF="../../../javax/mail/BodyPart.html">BodyPart</A></B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE><A HREF="../../../javax/mail/BodyPart.html#getParent()">getParent</A></CODE></TD>
</TR>
</TABLE>
<A NAME="methods_inherited_from_class_java.lang.Object"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#EEEEFF" CLASS="TableSubHeadingColor">
<TD><B>Methods inherited from class java.lang.Object</B></TD>
</TR>
<TR BGCOLOR="white" CLASS="TableRowColor">
<TD><CODE>clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait</CODE></TD>
</TR>
</TABLE>
<P>
<!-- ============ FIELD DETAIL =========== -->
<A NAME="field_detail"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Field Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="dh"><!-- --></A><H3>
dh</H3>
<PRE>
protected <A HREF="../../../javax/activation/DataHandler.html">DataHandler</A> <B>dh</B></PRE>
<DL>
<DD>The DataHandler object representing this Part's content.</DL>
<HR>
<A NAME="content"><!-- --></A><H3>
content</H3>
<PRE>
protected byte[] <B>content</B></PRE>
<DL>
<DD>Byte array that holds the bytes of the content of this Part.</DL>
<HR>
<A NAME="contentStream"><!-- --></A><H3>
contentStream</H3>
<PRE>
protected java.io.InputStream <B>contentStream</B></PRE>
<DL>
<DD>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.<DD><DL>
<DT><B>Since: </B><DD>JavaMail 1.2</DD>
</DL>
</DD>
</DL>
<HR>
<A NAME="headers"><!-- --></A><H3>
headers</H3>
<PRE>
protected <A HREF="../../../javax/mail/internet/InternetHeaders.html">InternetHeaders</A> <B>headers</B></PRE>
<DL>
<DD>The InternetHeaders object that stores all the headers
of this body part.</DL>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<A NAME="constructor_detail"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Constructor Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="MimeBodyPart()"><!-- --></A><H3>
MimeBodyPart</H3>
<PRE>
public <B>MimeBodyPart</B>()</PRE>
<DL>
<DD>An empty MimeBodyPart object is created.
This body part maybe filled in by a client constructing a multipart
message.</DL>
<HR>
<A NAME="MimeBodyPart(java.io.InputStream)"><!-- --></A><H3>
MimeBodyPart</H3>
<PRE>
public <B>MimeBodyPart</B>(java.io.InputStream is)
throws <A HREF="../../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>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.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>is</CODE> - the body part Input Stream</DL>
</DD>
</DL>
<HR>
<A NAME="MimeBodyPart(javax.mail.internet.InternetHeaders, byte[])"><!-- --></A><H3>
MimeBodyPart</H3>
<PRE>
public <B>MimeBodyPart</B>(<A HREF="../../../javax/mail/internet/InternetHeaders.html">InternetHeaders</A> headers,
byte[] content)
throws <A HREF="../../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>Constructs a MimeBodyPart using the given header and
content bytes. <p>
Used by providers.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>headers</CODE> - The header of this part<DD><CODE>content</CODE> - bytes representing the body of this part.</DL>
</DD>
</DL>
<!-- ============ METHOD DETAIL ========== -->
<A NAME="method_detail"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<TD COLSPAN=1><FONT SIZE="+2">
<B>Method Detail</B></FONT></TD>
</TR>
</TABLE>
<A NAME="getSize()"><!-- --></A><H3>
getSize</H3>
<PRE>
public int <B>getSize</B>()
throws <A HREF="../../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>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.<DD><DL>
<DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/mail/Part.html#getSize()">getSize</A></CODE> in interface <CODE><A HREF="../../../javax/mail/Part.html">Part</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>size in bytes, or -1 if not known</DL>
</DD>
</DL>
<HR>
<A NAME="getLineCount()"><!-- --></A><H3>
getLineCount</H3>
<PRE>
public int <B>getLineCount</B>()
throws <A HREF="../../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>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.<DD><DL>
<DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/mail/Part.html#getLineCount()">getLineCount</A></CODE> in interface <CODE><A HREF="../../../javax/mail/Part.html">Part</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>number of lines, or -1 if not known</DL>
</DD>
</DL>
<HR>
<A NAME="getContentType()"><!-- --></A><H3>
getContentType</H3>
<PRE>
public java.lang.String <B>getContentType</B>()
throws <A HREF="../../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>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.<DD><DL>
<DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/mail/Part.html#getContentType()">getContentType</A></CODE> in interface <CODE><A HREF="../../../javax/mail/Part.html">Part</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>Content-Type of this body part</DL>
</DD>
</DL>
<HR>
<A NAME="isMimeType(java.lang.String)"><!-- --></A><H3>
isMimeType</H3>
<PRE>
public boolean <B>isMimeType</B>(java.lang.String mimeType)
throws <A HREF="../../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>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.<DD><DL>
<DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/mail/Part.html#isMimeType(java.lang.String)">isMimeType</A></CODE> in interface <CODE><A HREF="../../../javax/mail/Part.html">Part</A></CODE></DL>
</DD>
</DL>
<HR>
<A NAME="getDisposition()"><!-- --></A><H3>
getDisposition</H3>
<PRE>
public java.lang.String <B>getDisposition</B>()
throws <A HREF="../../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>Returns the value of 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.<DD><DL>
<DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/mail/Part.html#getDisposition()">getDisposition</A></CODE> in interface <CODE><A HREF="../../../javax/mail/Part.html">Part</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>See Also: </B><DD><A HREF="../../../javax/mail/internet/MimeBodyPart.html#headers"><CODE>headers</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="setDisposition(java.lang.String)"><!-- --></A><H3>
setDisposition</H3>
<PRE>
public void <B>setDisposition</B>(java.lang.String disposition)
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?