mimebodypart.html

来自「SUN公司官方J2EE中文帮助文档 应该不错 有兴趣的下来看看 html格式的」· HTML 代码 · 共 1,360 行 · 第 1/5 页

HTML
1,360
字号
                    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>Specified by: </B><DD><CODE><A HREF="../../../javax/mail/Part.html#setDisposition(java.lang.String)">setDisposition</A></CODE> in interface <CODE><A HREF="../../../javax/mail/Part.html">Part</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/mail/IllegalWriteException.html">IllegalWriteException</A></CODE> - if the underlying
			implementation does not support modification<DD><CODE>java.lang.IllegalStateException</CODE> - 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><CODE><A HREF="../../../javax/mail/internet/MimePart.html#getEncoding()">getEncoding</A></CODE> in interface <CODE><A HREF="../../../javax/mail/internet/MimePart.html">MimePart</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="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><CODE><A HREF="../../../javax/mail/internet/MimePart.html#getContentID()">getContentID</A></CODE> in interface <CODE><A HREF="../../../javax/mail/internet/MimePart.html">MimePart</A></CODE></DL>
</DD>
<DD>Following copied from interface: <CODE>javax.mail.internet.MimePart</CODE></DD>
<DD><DL>
<DT><B>Returns:</B><DD>content-ID</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><CODE><A HREF="../../../javax/mail/internet/MimePart.html#getContentMD5()">getContentMD5</A></CODE> in interface <CODE><A HREF="../../../javax/mail/internet/MimePart.html">MimePart</A></CODE></DL>
</DD>
<DD>Following copied from interface: <CODE>javax.mail.internet.MimePart</CODE></DD>
<DD><DL>
<DT><B>Returns:</B><DD>content-MD5</DL>
</DD>
</DL>
<HR>

<A NAME="setContentMD5(java.lang.String)"><!-- --></A><H3>
setContentMD5</H3>
<PRE>
public void <B>setContentMD5</B>(java.lang.String&nbsp;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><CODE><A HREF="../../../javax/mail/internet/MimePart.html#setContentMD5(java.lang.String)">setContentMD5</A></CODE> in interface <CODE><A HREF="../../../javax/mail/internet/MimePart.html">MimePart</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/mail/IllegalWriteException.html">IllegalWriteException</A></CODE> - if the underlying
			implementation does not support modification<DD><CODE>java.lang.IllegalStateException</CODE> - 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>
 to obtain the requisite header field.<DD><DL>
<DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/mail/internet/MimePart.html#getContentLanguage()">getContentLanguage</A></CODE> in interface <CODE><A HREF="../../../javax/mail/internet/MimePart.html">MimePart</A></CODE></DL>
</DD>
</DL>
<HR>

<A NAME="setContentLanguage(java.lang.String[])"><!-- --></A><H3>
setContentLanguage</H3>
<PRE>
public void <B>setContentLanguage</B>(java.lang.String[]&nbsp;languages)
                        throws <A HREF="../../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>Set the Content-Language header of this MimePart. The
 Content-Language header is defined by RFC 1766.<DD><DL>
<DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/mail/internet/MimePart.html#setContentLanguage(java.lang.String[])">setContentLanguage</A></CODE> in interface <CODE><A HREF="../../../javax/mail/internet/MimePart.html">MimePart</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>languages</CODE> - array of language tags</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>Returns the "Content-Description" header field of this body part.
 This typically associates some descriptive information with 
 this part. Returns null if this field is unavailable or its
 value is absent. <p>

 If the Content-Description field is encoded as per RFC 2047,
 it is decoded and converted into Unicode. If the decoding or 
 conversion fails, the raw data is returned as is. <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#getDescription()">getDescription</A></CODE> in interface <CODE><A HREF="../../../javax/mail/Part.html">Part</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>content description</DL>
</DD>
</DL>
<HR>

<A NAME="setDescription(java.lang.String)"><!-- --></A><H3>
setDescription</H3>
<PRE>
public void <B>setDescription</B>(java.lang.String&nbsp;description)
                    throws <A HREF="../../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>Set the "Content-Description" header field for this body part.
 If the description parameter is <code>null</code>, then any 
 existing "Content-Description" fields are removed. <p>

 If the description contains non US-ASCII characters, it will 
 be encoded using the platform's default charset. If the 
 description contains only US-ASCII characters, no encoding 
 is done and it is used as is. <p>

 Note that if the charset encoding process fails, a
 MessagingException is thrown, and an UnsupportedEncodingException
 is included in the chain of nested exceptions within the
 MessagingException.<DD><DL>
<DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/mail/Part.html#setDescription(java.lang.String)">setDescription</A></CODE> in interface <CODE><A HREF="../../../javax/mail/Part.html">Part</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>description</CODE> - content description<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/mail/IllegalWriteException.html">IllegalWriteException</A></CODE> - if the underlying
			implementation does not support modification<DD><CODE>java.lang.IllegalStateException</CODE> - if this body part is
			obtained from a READ_ONLY folder.<DD><CODE>MessagingException.</CODE> - An
                  UnsupportedEncodingException may be included
                  in the exception chain if the charset
                  conversion fails.</DL>
</DD>
</DL>
<HR>

<A NAME="setDescription(java.lang.String, java.lang.String)"><!-- --></A><H3>
setDescription</H3>
<PRE>
public void <B>setDescription</B>(java.lang.String&nbsp;description,
                           java.lang.String&nbsp;charset)
                    throws <A HREF="../../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>Set the "Content-Description" header field for this body part.
 If the description parameter is <code>null</code>, then any 
 existing "Content-Description" fields are removed. <p>

 If the description contains non US-ASCII characters, it will 
 be encoded using the specified charset. If the description 
 contains only US-ASCII characters, no encoding  is done and 
 it is used as is. <p>

 Note that if the charset encoding process fails, a
 MessagingException is thrown, and an UnsupportedEncodingException
 is included in the chain of nested exceptions within the
 MessagingException.<DD><DL>
</DL>
</DD>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>description</CODE> - Description<DD><CODE>charset</CODE> - Charset for encoding<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/mail/IllegalWriteException.html">IllegalWriteException</A></CODE> - if the underlying
			implementation does not support modification<DD><CODE>java.lang.IllegalStateException</CODE> - if this body part is
			obtained from a READ_ONLY folder.<DD><CODE>MessagingException.</CODE> - An
                  UnsupportedEncodingException may be included
                  in the exception chain if the charset
                  conversion fails.</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 body part. <p>

 Returns the value of the "filename" parameter from the
 "Content-Disposition" header field of this body part. If its
 not available, returns the value of the "name" parameter from
 the "Content-Type" header field of this body part.
 Returns <code>null</code> if both are absent.<DD><DL>
<DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/mail/Part.html#getFileName()">getFileName</A></CODE> in interface <CODE><A HREF="../../../javax/mail/Part.html">Part</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Returns:</B><DD>filename</DL>
</DD>
</DL>
<HR>

<A NAME="setFileName(java.lang.String)"><!-- --></A><H3>
setFileName</H3>
<PRE>
public void <B>setFileName</B>(java.lang.String&nbsp;filename)
                 throws <A HREF="../../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>Set the filename associated with this body part, if possible. <p>

 Sets the "filename" parameter of the "Content-Disposition"
 header field of this body part.<DD><DL>
<DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/mail/Part.html#setFileName(java.lang.String)">setFileName</A></CODE> in interface <CODE><A HREF="../../../javax/mail/Part.html">Part</A></CODE></DL>
</DD>
<DD><DL>
<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/mail/IllegalWriteException.html">IllegalWriteException</A></CODE> - if the underlying
			implementation does not support modification<DD><CODE>java.lang.IllegalStateException</CODE> - if this body 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>()
                                   throws java.io.IOException,
                                          <A HREF="../../../javax/mail/MessagingException.html">MessagingException</A></PRE>
<DL>
<DD>Return a decoded input stream for this body part's "content". <p>

 This implementation obtains the input stream from the DataHandler.
 That is, it invokes getDataHandler().getInputStream();<DD><DL>
<DT><B>Specified by: </B><DD><CODE><A HREF="../../../javax/mail/Part.html#getInputStream()">getInputStream</A></CODE> in interface <CODE><A HREF="../../../javax/mail/Part.html">Part</A></CODE></DL>

⌨️ 快捷键说明

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