📄 part.html
字号:
<CODE> <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/InputStream.html" title="class or interface in java.io">InputStream</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/mail/Part.html#getInputStream()">getInputStream</A></B>()</CODE><BR> Return an input stream for this part's "content". </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/mail/Part.html#getLineCount()">getLineCount</A></B>()</CODE><BR> Return the number of lines in the content of this part. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/Enumeration.html" title="class or interface in java.util">Enumeration</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/mail/Part.html#getMatchingHeaders(java.lang.String[])">getMatchingHeaders</A></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>[] header_names)</CODE><BR> Return matching headers from this part as an Enumeration of Header objects.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/util/Enumeration.html" title="class or interface in java.util">Enumeration</A></CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/mail/Part.html#getNonMatchingHeaders(java.lang.String[])">getNonMatchingHeaders</A></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>[] header_names)</CODE><BR> Return non-matching headers from this envelope as an Enumeration of Header objects.</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> int</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/mail/Part.html#getSize()">getSize</A></B>()</CODE><BR> Return the size of the content of this part in bytes. </TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE> boolean</CODE></FONT></TD><TD><CODE><B><A HREF="../../javax/mail/Part.html#isMimeType(java.lang.String)">isMimeType</A></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> mimeType)</CODE><BR> Is this Part of the specified MIME type? </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/Part.html#removeHeader(java.lang.String)">removeHeader</A></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> header_name)</CODE><BR> Remove all headers with this name.</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/Part.html#setContent(javax.mail.Multipart)">setContent</A></B>(<A HREF="../../javax/mail/Multipart.html" title="class in javax.mail">Multipart</A> mp)</CODE><BR> This method sets the given Multipart object as this message's content.</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/Part.html#setContent(java.lang.Object, java.lang.String)">setContent</A></B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html" title="class or interface in java.lang">Object</A> obj, <A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A> type)</CODE><BR> A convenience method for setting this part's content. </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/Part.html#setDataHandler(javax.activation.DataHandler)">setDataHandler</A></B>(<A HREF="../../javax/activation/DataHandler.html" title="class in javax.activation">DataHandler</A> dh)</CODE><BR> This method provides the mechanism to set this part's content. </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/Part.html#setDescription(java.lang.String)">setDescription</A></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> description)</CODE><BR> Set a description String for this part. </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/Part.html#setDisposition(java.lang.String)">setDisposition</A></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> disposition)</CODE><BR> Set the disposition of this part.</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/Part.html#setFileName(java.lang.String)">setFileName</A></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> filename)</CODE><BR> Set the filename associated with this part, if possible. </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/Part.html#setHeader(java.lang.String, java.lang.String)">setHeader</A></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> header_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> header_value)</CODE><BR> Set the value for this header_name. </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/Part.html#setText(java.lang.String)">setText</A></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> text)</CODE><BR> A convenience method that sets the given String as this part's content with a MIME type of "text/plain".</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/Part.html#writeTo(java.io.OutputStream)">writeTo</A></B>(<A HREF="http://java.sun.com/j2se/1.4/docs/api/java/io/OutputStream.html" title="class or interface in java.io">OutputStream</A> os)</CODE><BR> Output a bytestream for this Part. </TD></TR></TABLE> <P><!-- ============ FIELD DETAIL =========== --><A NAME="field_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TD COLSPAN=1><FONT SIZE="+2"><B>Field Detail</B></FONT></TD></TR></TABLE><A NAME="ATTACHMENT"><!-- --></A><H3>ATTACHMENT</H3><PRE>public static final <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>ATTACHMENT</B></PRE><DL><DD>This part should be presented as an attachment.<P><DL><DT><B>See Also:</B><DD><A HREF="../../javax/mail/Part.html#getDisposition()"><CODE>getDisposition()</CODE></A>, <A HREF="../../javax/mail/Part.html#setDisposition(java.lang.String)"><CODE>setDisposition(java.lang.String)</CODE></A>, <A HREF="../../constant-values.html#javax.mail.Part.ATTACHMENT">Constant Field Values</A></DL></DL><HR><A NAME="INLINE"><!-- --></A><H3>INLINE</H3><PRE>public static final <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>INLINE</B></PRE><DL><DD>This part should be presented inline.<P><DL><DT><B>See Also:</B><DD><A HREF="../../javax/mail/Part.html#getDisposition()"><CODE>getDisposition()</CODE></A>, <A HREF="../../javax/mail/Part.html#setDisposition(java.lang.String)"><CODE>setDisposition(java.lang.String)</CODE></A>, <A HREF="../../constant-values.html#javax.mail.Part.INLINE">Constant Field Values</A></DL></DL><!-- ========= CONSTRUCTOR DETAIL ======== --><!-- ============ 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="getSize()"><!-- --></A><H3>getSize</H3><PRE>public int <B>getSize</B>() throws <A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></PRE><DL><DD>Return the size of the content of this part in bytes. Return -1 if the size cannot be determined. <p> Note that the size may not be an exact measure of the content size and may or may not account for any transfer encoding of the content. The size is appropriate for display in a user interface to give the user a rough idea of the size of this part.<P><DD><DL><DT><B>Returns:</B><DD>size of content in bytes<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="getLineCount()"><!-- --></A><H3>getLineCount</H3><PRE>public int <B>getLineCount</B>() throws <A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></PRE><DL><DD>Return the number of lines in the content of this part. Return -1 if the number cannot be determined. 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><DD><DL><DT><B>Returns:</B><DD>number of lines in the content.<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="getContentType()"><!-- --></A><H3>getContentType</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>getContentType</B>() throws <A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></PRE><DL><DD>Returns the Content-Type of the content of this part. Returns null if the Content-Type could not be determined. <p> The MIME typing system is used to name Content-types.<P><DD><DL><DT><B>Returns:</B><DD>The ContentType of this part<DT><B>Throws:</B><DD><CODE><A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></CODE><DT><B>See Also:</B><DD><A HREF="../../javax/activation/DataHandler.html" title="class in javax.activation"><CODE>DataHandler</CODE></A></DL></DD></DL><HR><A NAME="isMimeType(java.lang.String)"><!-- --></A><H3>isMimeType</H3><PRE>public boolean <B>isMimeType</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> mimeType) throws <A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">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>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -