📄 part.html
字号:
</TR>
<TR BGCOLOR="white" ID="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">Multipart</A> mp)</CODE>
<BR>
This method sets the given Multipart object as this message's
content.</TD>
</TR>
<TR BGCOLOR="white" ID="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>(java.lang.Object obj,
java.lang.String type)</CODE>
<BR>
A convenience method for setting this part's content.</TD>
</TR>
<TR BGCOLOR="white" ID="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>(javax.activation.DataHandler dh)</CODE>
<BR>
This method provides the mechanism to set this part's content.</TD>
</TR>
<TR BGCOLOR="white" ID="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>(java.lang.String description)</CODE>
<BR>
Set a description String for this part.</TD>
</TR>
<TR BGCOLOR="white" ID="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>(java.lang.String disposition)</CODE>
<BR>
Set the disposition of this part.</TD>
</TR>
<TR BGCOLOR="white" ID="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>(java.lang.String filename)</CODE>
<BR>
Set the filename associated with this part, if possible.</TD>
</TR>
<TR BGCOLOR="white" ID="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>(java.lang.String header_name,
java.lang.String header_value)</CODE>
<BR>
Set the value for this header_name.</TD>
</TR>
<TR BGCOLOR="white" ID="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>(java.lang.String 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" ID="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>(java.io.OutputStream os)</CODE>
<BR>
Output a bytestream for this Part.</TD>
</TR>
</TABLE>
<P>
<!-- ============ FIELD DETAIL =========== -->
<A NAME="field_detail"><!-- --></A>
<TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%">
<TR BGCOLOR="#CCCCFF" ID="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 java.lang.String <B>ATTACHMENT</B></PRE>
<DL>
<DD>This part should be presented as an attachment.<DD><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></DL>
</DD>
</DL>
<HR>
<A NAME="INLINE"><!-- --></A><H3>
INLINE</H3>
<PRE>
public static final java.lang.String <B>INLINE</B></PRE>
<DL>
<DD>This part should be presented inline.<DD><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></DL>
</DD>
</DL>
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<!-- ============ 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 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.<DD><DL>
<DT><B>Returns:</B><DD>size of content in bytes<DT><B>Throws:</B><DD><A HREF="../../javax/mail/MessagingException.html">MessagingException</A> - </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 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.<DD><DL>
<DT><B>Returns:</B><DD>number of lines in the content.<DT><B>Throws:</B><DD><A HREF="../../javax/mail/MessagingException.html">MessagingException</A> - </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 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.<DD><DL>
<DT><B>Returns:</B><DD>The ContentType of this part<DT><B>Throws:</B><DD><A HREF="../../javax/mail/MessagingException.html">MessagingException</A> - <DT><B>See Also: </B><DD><CODE>DataHandler</CODE></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.</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>Return the disposition of this part. The disposition
describes how the part should be presented to the user.<DD><DL>
<DT><B>Returns:</B><DD>disposition of this part, or null if unknown<DT><B>Throws:</B><DD><A HREF="../../javax/mail/MessagingException.html">MessagingException</A> - <DT><B>See Also: </B><DD><A HREF="../../javax/mail/Part.html#ATTACHMENT"><CODE>ATTACHMENT</CODE></A>,
<A HREF="../../javax/mail/Part.html#INLINE"><CODE>INLINE</CODE></A>,
<A HREF="../../javax/mail/Part.html#getFileName()"><CODE>getFileName()</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 disposition of this part.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>disposition</CODE> - disposition of this part<DT><B>Throws:</B><DD><A HREF="../../javax/mail/MessagingException.html">MessagingException</A> - <DD><A HREF="../../javax/mail/IllegalWriteException.html">IllegalWriteException</A> - if the underlying implementation
does not support modification of this header<DD>IllegalStateException - if this Part is obtained
from a READ_ONLY folder<DT><B>See Also: </B><DD><A HREF="../../javax/mail/Part.html#ATTACHMENT"><CODE>ATTACHMENT</CODE></A>,
<A HREF="../../javax/mail/Part.html#INLINE"><CODE>INLINE</CODE></A>,
<A HREF="../../javax/mail/Part.html#setFileName(java.lang.String)"><CODE>setFileName(java.lang.String)</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="getDescription()"><!-- --></A><H3>
getDescription</H3>
<PRE>
public java.lang.String <B>getDescription</B>()
throws <A HREF="../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>Return a description String for this part. This typically
associates some descriptive information with this part.
Returns null if none is available.<DD><DL>
<DT><B>Returns:</B><DD>description of this part<DT><B>Throws:</B><DD><A HREF="../../javax/mail/MessagingException.html">MessagingException</A> - </DL>
</DD>
</DL>
<HR>
<A NAME="setDescription(java.lang.String)"><!-- --></A><H3>
setDescription</H3>
<PRE>
public void <B>setDescription</B>(java.lang.String description)
throws <A HREF="../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>Set a description String for this part. This typically
associates some descriptive information with this part.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>description</CODE> - description of this part<DT><B>Throws:</B><DD><A HREF="../../javax/mail/MessagingException.html">MessagingException</A> - <DD><A HREF="../../javax/mail/IllegalWriteException.html">IllegalWriteException</A> - if the underlying implementation
does not support modification of this header<DD>IllegalStateException - if this Part is obtained
from a READ_ONLY folder</DL>
</DD>
</DL>
<HR>
<A NAME="getFileName()"><!-- --></A><H3>
getFileName</H3>
<PRE>
public java.lang.String <B>getFileName</B>()
throws <A HREF="../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>Get the filename associated with this part, if possible.
Useful if this part represents an "attachment" that was
loaded from a file. The filename will usually be a simple
name, not including directory components.<DD><DL>
<DT><B>Returns:</B><DD>Filename to associate with this part</DL>
</DD>
</DL>
<HR>
<A NAME="setFileName(java.lang.String)"><!-- --></A><H3>
setFileName</H3>
<PRE>
public void <B>setFileName</B>(java.lang.String filename)
throws <A HREF="../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>Set the filename associated with this part, if possible.
Useful if this part represents an "attachment" that was
loaded from a file. The filename will usually be a simple
name, not including directory components.<DD><DL>
<DT><B>Parameters:</B><DD><CODE>filename</CODE> - Filename to associate with this part<DT><B>Throws:</B><DD><A HREF="../../javax/mail/IllegalWriteException.html">IllegalWriteException</A> - if the underlying implementation
does not support modification of this header<DD>IllegalStateException - if this Part is obtained
from a READ_ONLY folder</DL>
</DD>
</DL>
<HR>
<A NAME="getInputStream()"><!-- --></A><H3>
getInputStream</H3>
<PRE>
public java.io.InputStream <B>getInputStream</B>()
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -