mimebodypart.html
来自「SUN的JAVA MAIL API」· HTML 代码 · 共 1,410 行 · 第 1/5 页
HTML
1,410 行
<PRE>
protected javax.activation.DataHandler <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="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" ID="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" ID="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 -1;<DD><DL>
<DT><B>Returns:</B><DD>size in bytes</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>
</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>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>
</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>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)
throws <A HREF="../../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>Set the "Content-Disposition" header field of this body part.
If the disposition is null, any existing "Content-Disposition"
header field is removed.<DD><DL>
<DT><B>Throws:</B><DD><A HREF="../../../javax/mail/IllegalWriteException.html">IllegalWriteException</A> - if the underlying
implementation does not support modification<DD>IllegalStateException - if this body part is
obtained from a READ_ONLY folder.</DL>
</DD>
</DL>
<HR>
<A NAME="getEncoding()"><!-- --></A><H3>
getEncoding</H3>
<PRE>
public java.lang.String <B>getEncoding</B>()
throws <A HREF="../../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>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.<DD><DL>
<DT><B>Specified by: </B><DD><A HREF="../../../javax/mail/internet/MimePart.html#getEncoding()">getEncoding</A> in interface <A HREF="../../../javax/mail/internet/MimePart.html">MimePart</A><DT><B>See Also: </B><DD><A HREF="../../../javax/mail/internet/MimeBodyPart.html#headers"><CODE>headers</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="getContentID()"><!-- --></A><H3>
getContentID</H3>
<PRE>
public java.lang.String <B>getContentID</B>()
throws <A HREF="../../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>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.<DD><DL>
<DT><B>Specified by: </B><DD><A HREF="../../../javax/mail/internet/MimePart.html#getContentID()">getContentID</A> in interface <A HREF="../../../javax/mail/internet/MimePart.html">MimePart</A></DL>
</DD>
</DL>
<HR>
<A NAME="getContentMD5()"><!-- --></A><H3>
getContentMD5</H3>
<PRE>
public java.lang.String <B>getContentMD5</B>()
throws <A HREF="../../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>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.<DD><DL>
<DT><B>Specified by: </B><DD><A HREF="../../../javax/mail/internet/MimePart.html#getContentMD5()">getContentMD5</A> in interface <A HREF="../../../javax/mail/internet/MimePart.html">MimePart</A></DL>
</DD>
</DL>
<HR>
<A NAME="setContentMD5(java.lang.String)"><!-- --></A><H3>
setContentMD5</H3>
<PRE>
public void <B>setContentMD5</B>(java.lang.String md5)
throws <A HREF="../../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>Set the "Content-MD5" header field of this body part.<DD><DL>
<DT><B>Specified by: </B><DD><A HREF="../../../javax/mail/internet/MimePart.html#setContentMD5(java.lang.String)">setContentMD5</A> in interface <A HREF="../../../javax/mail/internet/MimePart.html">MimePart</A><DT><B>Throws:</B><DD><A HREF="../../../javax/mail/IllegalWriteException.html">IllegalWriteException</A> - if the underlying
implementation does not support modification<DD>IllegalStateException - if this body part is
obtained from a READ_ONLY folder.</DL>
</DD>
</DL>
<HR>
<A NAME="getContentLanguage()"><!-- --></A><H3>
getContentLanguage</H3>
<PRE>
public java.lang.String[] <B>getContentLanguage</B>()
throws <A HREF="../../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>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>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?