⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 mimebodypart.html

📁 j2ee帮助文档软件设计/软件工程 文件格式
💻 HTML
📖 第 1 页 / 共 5 页
字号:
<A NAME="constructor_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Constructor Detail</B></FONT></TH></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.<P></DL><HR><A NAME="MimeBodyPart(java.io.InputStream)"><!-- --></A><H3>MimeBodyPart</H3><PRE>public <B>MimeBodyPart</B>(<A HREF="http://java.sun.com/j2se/1.5/docs/api/java/io/InputStream.html" title="class or interface in java.io">InputStream</A>&nbsp;is)             throws <A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">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.<P><DL><DT><B>Parameters:</B><DD><CODE>is</CODE> - the body part Input Stream<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></CODE></DL></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" title="class in javax.mail.internet">InternetHeaders</A>&nbsp;headers,                    byte[]&nbsp;content)             throws <A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></PRE><DL><DD>Constructs a MimeBodyPart using the given header and content bytes. <p> Used by providers.<P><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.<DT><B>Throws:</B><DD><CODE><A HREF="../../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></CODE></DL></DL><!-- ============ METHOD DETAIL ========== --><A NAME="method_detail"><!-- --></A><TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY=""><TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor"><TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2"><B>Method Detail</B></FONT></TH></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.5/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.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;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.5/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.5/docs/api/java/lang/String.html" title="class or interface in java.lang">String</A>&nbsp;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.5/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>

⌨️ 快捷键说明

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