📄 mimebodypart.html
字号:
<!-- ============ 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 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.<P><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" title="interface in javax.mail">Part</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>size in bytes, or -1 if not known<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 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.<P><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" title="interface in javax.mail">Part</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>number of lines, or -1 if not known<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 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.<P><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" title="interface in javax.mail">Part</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>Content-Type of this body 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> If the <code>subType</code> of <code>mimeType</code> is the special character '*', then the subtype is ignored during the comparison.<P><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" title="interface in javax.mail">Part</A></CODE></DL></DD><DD><DL><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="getDisposition()"><!-- --></A><H3>getDisposition</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>getDisposition</B>() throws <A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">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.<P><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" title="interface in javax.mail">Part</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>disposition of this part, or null if unknown<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/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>(<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) throws <A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">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.<P><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" title="interface in javax.mail">Part</A></CODE></DL></DD><DD><DL><DT><B>Parameters:</B><DD><CODE>disposition</CODE> - disposition of this part<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/mail/IllegalWriteException.html" title="class in javax.mail">IllegalWriteException</A></CODE> - if the underlying implementation does not support modification<DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/IllegalStateException.html" title="class or interface in java.lang">IllegalStateException</A></CODE> - if this body part is obtained from a READ_ONLY folder.<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/mail/Part.html#ATTACHMENT"><CODE>Part.ATTACHMENT</CODE></A>, <A HREF="../../../javax/mail/Part.html#INLINE"><CODE>Part.INLINE</CODE></A>, <A HREF="../../../javax/mail/Part.html#setFileName(java.lang.String)"><CODE>Part.setFileName(java.lang.String)</CODE></A></DL></DD></DL><HR><A NAME="getEncoding()"><!-- --></A><H3>getEncoding</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>getEncoding</B>() throws <A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">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.<P><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" title="interface in javax.mail.internet">MimePart</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>content-transfer-encoding<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/mail/internet/MimeBodyPart.html#headers"><CODE>headers</CODE></A></DL></DD></DL><HR><A NAME="getContentID()"><!-- --></A><H3>getContentID</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>getContentID</B>() throws <A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">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.<P><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" title="interface in javax.mail.internet">MimePart</A></CODE></DL></DD><DD><DL><DT><B>Returns:</B><DD>content-ID<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="setContentID(java.lang.String)"><!-- --></A><H3>setContentID</H3><PRE>public void <B>setContentID</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> cid) throws <A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></PRE><DL><DD>Set the "Content-ID" header field of this body part. If the <code>cid</code> parameter is null, any existing "Content-ID" is removed.<P><DD><DL></DL></DD><DD><DL><DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/mail/IllegalWriteException.html" title="class in javax.mail">IllegalWriteException</A></CODE> - if the underlying implementation does not support modification<DD><CODE><A HREF="http://java.sun.com/j2se/1.4/docs/api/java/lang/IllegalStateException.html" title="class or interface in java.lang">IllegalStateException</A></CODE> - if this body part is obtained from a READ_ONLY folder.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -