<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!--NewPage-->
<!-- Generated by javadoc (build 1.6.0_10) on Tue Nov 17 12:13:38 PST 2009 -->
<
META http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
Part (JavaMail API documentation)
<
META NAME="date" CONTENT="2009-11-17">
<
LINK REL ="stylesheet" TYPE="text/css" HREF="../../stylesheet.css" TITLE="Style">
<
SCRIPT type="text/javascript">
function windowTitle()
{
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Part (JavaMail API documentation)";
}
}
<
BODY BGCOLOR="white" onload="windowTitle();">
<!-- ========= START OF TOP NAVBAR ======= -->
<
A NAME="navbar_top"><!-- --><
/A>
<
A HREF="#skip-navbar_top" title="Skip navigation links"><
/A>
<
TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<
TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<
A NAME="navbar_top_firstrow"><!-- --><
/A>
<
TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<
TR ALIGN="center" VALIGN="top">
<
TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <
A HREF="../../overview-summary.html"><
FONT CLASS="NavBarFont1"><
B>Overview<
/B><
/FONT><
/A> <
/TD>
<
TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <
A HREF="package-summary.html"><
FONT CLASS="NavBarFont1"><
B>Package<
/B><
/FONT><
/A> <
/TD>
<
TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <
FONT CLASS="NavBarFont1Rev"><
B>Class<
/B><
/FONT> <
/TD>
<
TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <
A HREF="class-use/Part.html"><
FONT CLASS="NavBarFont1"><
B>Use<
/B><
/FONT><
/A> <
/TD>
<
TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <
A HREF="package-tree.html"><
FONT CLASS="NavBarFont1"><
B>Tree<
/B><
/FONT><
/A> <
/TD>
<
TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <
A HREF="../../deprecated-list.html"><
FONT CLASS="NavBarFont1"><
B>Deprecated<
/B><
/FONT><
/A> <
/TD>
<
TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <
A HREF="../../index-files/index-1.html"><
FONT CLASS="NavBarFont1"><
B>Index<
/B><
/FONT><
/A> <
/TD>
<
TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <
A HREF="../../help-doc.html"><
FONT CLASS="NavBarFont1"><
B>Help<
/B><
/FONT><
/A> <
/TD>
<
TD ALIGN="right" VALIGN="top" ROWSPAN=3><
EM>
<
TD BGCOLOR="white" CLASS="NavBarCell2"><
FONT SIZE="-2">
<
A HREF="../../javax/mail/NoSuchProviderException.html" title="class in javax.mail"><
B>PREV CLASS<
/B><
/A>
<
A HREF="../../javax/mail/PasswordAuthentication.html" title="class in javax.mail"><
B>NEXT CLASS<
/B><
/A><
/FONT><
/TD>
<
TD BGCOLOR="white" CLASS="NavBarCell2"><
FONT SIZE="-2">
<
A HREF="../../index.html?javax/mail/Part.html" target="_top"><
B>FRAMES<
/B><
/A>
<
A HREF="Part.html" target="_top"><
B>NO FRAMES<
/B><
/A>
<
SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
<
A HREF="../../allclasses-noframe.html"><
B>All Classes<
/B><
/A>
<
TD VALIGN="top" CLASS="NavBarCell3"><
FONT SIZE="-2">
SUMMARY: NESTED | <
A HREF="#field_summary">FIELD<
/A> | CONSTR | <
A HREF="#method_summary">METHOD<
/A><
/FONT><
/TD>
<
TD VALIGN="top" CLASS="NavBarCell3"><
FONT SIZE="-2">
DETAIL: <
A HREF="#field_detail">FIELD<
/A> | CONSTR | <
A HREF="#method_detail">METHOD<
/A><
/FONT><
/TD>
<
A NAME="skip-navbar_top"><
/A>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<
DT><
B>All Known Subinterfaces:<
/B> <
DD><
A HREF="../../javax/mail/internet/MimePart.html" title="interface in javax.mail.internet">MimePart<
/A><
/DD>
<
DT><
B>All Known Implementing Classes:<
/B> <
DD><
A HREF="../../javax/mail/BodyPart.html" title="class in javax.mail">BodyPart<
/A>, <
A HREF="../../com/sun/mail/imap/IMAPMessage.html" title="class in com.sun.mail.imap">IMAPMessage<
/A>, <
A HREF="../../javax/mail/Message.html" title="class in javax.mail">Message<
/A>, <
A HREF="../../com/sun/mail/dsn/MessageHeaders.html" title="class in com.sun.mail.dsn">MessageHeaders<
/A>, <
A HREF="../../javax/mail/internet/MimeBodyPart.html" title="class in javax.mail.internet">MimeBodyPart<
/A>, <
A HREF="../../javax/mail/internet/MimeMessage.html" title="class in javax.mail.internet">MimeMessage<
/A>, <
A HREF="../../com/sun/mail/pop3/POP3Message.html" title="class in com.sun.mail.pop3">POP3Message<
/A>, <
A HREF="../../javax/mail/internet/PreencodedMimeBodyPart.html" title="class in javax.mail.internet">PreencodedMimeBodyPart<
/A>, <
A HREF="../../com/sun/mail/smtp/SMTPMessage.html" title="class in com.sun.mail.smtp">SMTPMessage<
/A><
/DD>
The <
code>Part<
/code> interface is the common base interface
for
Messages and BodyParts. <
p>
Part consists of a set of attributes and a
"Content".<
p>
The JavaMail API defines a set of standard Part attributes that are
considered to be common to most existing Mail systems. These
attributes have their own settor and gettor methods. Mail systems
may support other Part attributes as well, these are represented as
name-
value pairs where both the
name and
value are Strings.<
p>
The <
strong>
data type<
/strong> of the
"content" is returned by
the <
code>getContentType
()<
/code>
method. The MIME typing system
is used to
name data types. <
p>
The "content" of a Part is available in various formats:
<
li> As a DataHandler - using the <
code>getDataHandler
()<
/code>
method.
The "content" of a Part is also available through a
<
code>javax.activation.DataHandler<
/code>
object. The DataHandler
object allows clients to discover the operations available on the
content, and to instantiate the appropriate component to perform
those operations.
<
li> As an input stream - using the <
code>getInputStream
()<
/code>
method.
Any mail-specific encodings are decoded before this stream is returned.
<
li> As a Java
object - using the <
code>getContent
()<
/code>
method.
This method returns the "content" as a Java object.
The returned object is of course dependent on the content
itself. In particular, a "multipart" Part's content is always a
Multipart or subclass thereof. That is, <code>getContent()</code> on a
"multipart" type Part will always return a Multipart (or subclass) object.
</ul>
Part provides the <code>writeTo()</code> method that streams
out its bytestream in mail-safe form suitable for transmission.
This bytestream is typically an aggregation of the Part attributes
and its content's bytestream. <
p>
Message and BodyPart implement the Part interface. Note that in
MIME parlance, Part models an Entity (RFC 2045, Section 2.4).
<!-- =========== FIELD SUMMARY =========== -->
<
A NAME="field_summary"><!-- --><
/A>
<
TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<
TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<
TH ALIGN="left" COLSPAN="2"><
FONT SIZE="+2">
<
TR BGCOLOR="white" CLASS="TableRowColor">
<
TD ALIGN="right" VALIGN="top" WIDTH="1%"><
FONT SIZE="-1">
<
CODE>static <
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String<
/A><
/CODE><
/FONT><
/TD>
<
TD><
CODE><
B><
A HREF="../../javax/mail/Part.html#ATTACHMENT">ATTACHMENT<
/A><
/B><
/CODE>
This part should be presented as an attachment.<
/TD>
<
TR BGCOLOR="white" CLASS="TableRowColor">
<
TD ALIGN="right" VALIGN="top" WIDTH="1%"><
FONT SIZE="-1">
<
CODE>static <
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String<
/A><
/CODE><
/FONT><
/TD>
<
TD><
CODE><
B><
A HREF="../../javax/mail/Part.html#INLINE">INLINE<
/A><
/B><
/CODE>
This part should be presented inline.<
/TD>
<!-- ========== METHOD SUMMARY =========== -->
<
A NAME="method_summary"><!-- --><
/A>
<
TABLE BORDER="1" WIDTH="100%" CELLPADDING="3" CELLSPACING="0" SUMMARY="">
<
TR BGCOLOR="#CCCCFF" CLASS="TableHeadingColor">
<
TH ALIGN="left" COLSPAN="2"><
FONT SIZE="+2">
<
TR BGCOLOR="white" CLASS="TableRowColor">
<
TD ALIGN="right" VALIGN="top" WIDTH="1%"><
FONT SIZE="-1">
<
TD><
CODE><
B><
A HREF="../../javax/mail/Part.html#addHeader(java.lang.String, java.lang.String)">addHeader<
/A><
/B>
(<
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String<
/A> header_name,
<
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String<
/A> header_value
)<
/CODE>
Add this
value to the existing values
for this header_name.<
/TD>
<
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.2/docs/api/java/util/Enumeration.html?is-external=true" title="class or interface in java.util">Enumeration<
/A><
/CODE><
/FONT><
/TD>
<
TD><
CODE><
B><
A HREF="../../javax/mail/Part.html#getAllHeaders()">getAllHeaders<
/A><
/B>
()<
/CODE>
Return all the headers from this part as an Enumeration of
<
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.2/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object<
/A><
/CODE><
/FONT><
/TD>
<
TD><
CODE><
B><
A HREF="../../javax/mail/Part.html#getContent()">getContent<
/A><
/B>
()<
/CODE>
Return the
content as a Java
object.<
/TD>
<
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.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String<
/A><
/CODE><
/FONT><
/TD>
<
TD><
CODE><
B><
A HREF="../../javax/mail/Part.html#getContentType()">getContentType<
/A><
/B>
()<
/CODE>
Returns the Content-
Type of the
content of this part.<
/TD>
<
TR BGCOLOR="white" CLASS="TableRowColor">
<
TD ALIGN="right" VALIGN="top" WIDTH="1%"><
FONT SIZE="-1">
<
CODE> <
A HREF="http://java.sun.com/javase/technologies/desktop/javabeans/glasgow/javadocs/javax/activation/DataHandler.html?is-external=true" title="class or interface in javax.activation">DataHandler<
/A><
/CODE><
/FONT><
/TD>
<
TD><
CODE><
B><
A HREF="../../javax/mail/Part.html#getDataHandler()">getDataHandler<
/A><
/B>
()<
/CODE>
Return a DataHandler
for the
content within this part.<
/TD>
<
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.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String<
/A><
/CODE><
/FONT><
/TD>
<
TD><
CODE><
B><
A HREF="../../javax/mail/Part.html#getDescription()">getDescription<
/A><
/B>
()<
/CODE>
Return a description String
for this part.<
/TD>
<
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.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String<
/A><
/CODE><
/FONT><
/TD>
<
TD><
CODE><
B><
A HREF="../../javax/mail/Part.html#getDisposition()">getDisposition<
/A><
/B>
()<
/CODE>
Return the disposition of this part.<
/TD>
<
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.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String<
/A><
/CODE><
/FONT><
/TD>
<
TD><
CODE><
B><
A HREF="../../javax/mail/Part.html#getFileName()">getFileName<
/A><
/B>
()<
/CODE>
Get the filename associated with this part, if possible.<
/TD>
<
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.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String<
/A>
[]<
/CODE><
/FONT><
/TD>
<
TD><
CODE><
B><
A HREF="../../javax/mail/Part.html#getHeader(java.lang.String)">getHeader<
/A><
/B>
(<
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String<
/A> header_name
)<
/CODE>
Get all the
headers for this header
name.<
/TD>
<
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.2/docs/api/java/io/InputStream.html?is-external=true" 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>
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.2/docs/api/java/util/Enumeration.html?is-external=true" 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.2/docs/api/java/lang/String.html?is-external=true" 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.2/docs/api/java/util/Enumeration.html?is-external=true" 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.2/docs/api/java/lang/String.html?is-external=true" 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.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> mimeType)</CODE>
<BR>
Is this Part of the specified MIME type? This method
compares <strong>only the <code>primaryType</code> and
<code>subType</code></strong>.</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.2/docs/api/java/lang/String.html?is-external=true" 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
<
TR BGCOLOR="white" CLASS="TableRowColor">
<
TD ALIGN="right" VALIGN="top" WIDTH="1%"><
FONT SIZE="-1">
<
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.2/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object<
/A> obj,
<
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String<
/A>
type)<
/CODE>
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="http://java.sun.com/javase/technologies/desktop/javabeans/glasgow/javadocs/javax/activation/DataHandler.html?is-external=true" title="class or interface in javax.activation">DataHandler</A> dh)</CODE>
<BR>
This method provides the mechanism to set this part's
content.<
/TD>
<
TR BGCOLOR="white" CLASS="TableRowColor">
<
TD ALIGN="right" VALIGN="top" WIDTH="1%"><
FONT SIZE="-1">
<
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.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String<
/A> description
)<
/CODE>
Set a description String
for this part.<
/TD>
<
TR BGCOLOR="white" CLASS="TableRowColor">
<
TD ALIGN="right" VALIGN="top" WIDTH="1%"><
FONT SIZE="-1">
<
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.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String<
/A> disposition
)<
/CODE>
Set the disposition of this part.<
/TD>
<
TR BGCOLOR="white" CLASS="TableRowColor">
<
TD ALIGN="right" VALIGN="top" WIDTH="1%"><
FONT SIZE="-1">
<
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.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String<
/A> filename
)<
/CODE>
Set the filename associated with this part, if possible.<
/TD>
<
TR BGCOLOR="white" CLASS="TableRowColor">
<
TD ALIGN="right" VALIGN="top" WIDTH="1%"><
FONT SIZE="-1">
<
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.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String<
/A> header_name,
<
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String<
/A> header_value
)<
/CODE>
Set the
value for this header_name.<
/TD>
<
TR BGCOLOR="white" CLASS="TableRowColor">
<
TD ALIGN="right" VALIGN="top" WIDTH="1%"><
FONT SIZE="-1">
<
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.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String<
/A>
text)<
/CODE>
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.2/docs/api/java/io/OutputStream.html?is-external=true" 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">
<TH ALIGN="left" COLSPAN="1"><FONT SIZE="+2">
<B>Field Detail</B></FONT></TH>
</TR>
</TABLE>
<A NAME="ATTACHMENT"><!-- --></A><H3>
ATTACHMENT</H3>
<PRE>
static final <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" 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>
static final <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" 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>
<!-- ============ 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>
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>
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>
<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" 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="http://java.sun.com/javase/technologies/desktop/javabeans/glasgow/javadocs/javax/activation/DataHandler.html?is-external=true" title="class or interface in javax.activation"><CODE>DataHandler</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="isMimeType(java.lang.String)"><!-- --></A><H3>
isMimeType</H3>
<PRE>
boolean <B>isMimeType</B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" 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>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>
<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" 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>Return the disposition of this part. The disposition
describes how the part should be presented to the user.
(See RFC 2183.) The return value should be considered
without regard to case. For example: <p>
<blockquote><pre>
String disp = part.getDisposition();
if (disp == null || disp.equalsIgnoreCase(Part.ATTACHMENT))
// treat as attachment if not first part
</pre></blockquote>
<P>
<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/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>
void <B>setDisposition</B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" 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 disposition of this part.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>disposition</CODE> - disposition of this part
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></CODE>
<DD><CODE><A HREF="../../javax/mail/IllegalWriteException.html" title="class in javax.mail">IllegalWriteException</A></CODE> - if the underlying implementation
does not support modification of this header
<DD><CODE><A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</A></CODE> - 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>
<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>getDescription</B>()
throws <A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">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.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>description of this part
<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="setDescription(java.lang.String)"><!-- --></A><H3>
setDescription</H3>
<PRE>
void <B>setDescription</B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> description)
throws <A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></PRE>
<DL>
<DD>Set a description String for this part. This typically
associates some descriptive information with this part.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>description</CODE> - description of this part
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></CODE>
<DD><CODE><A HREF="../../javax/mail/IllegalWriteException.html" title="class in javax.mail">IllegalWriteException</A></CODE> - if the underlying implementation
does not support modification of this header
<DD><CODE><A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</A></CODE> - if this Part is obtained
from a READ_ONLY folder</DL>
</DD>
</DL>
<HR>
<A NAME="getFileName()"><!-- --></A><H3>
getFileName</H3>
<PRE>
<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> <B>getFileName</B>()
throws <A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">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.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>Filename to associate with this part
<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="setFileName(java.lang.String)"><!-- --></A><H3>
setFileName</H3>
<PRE>
void <B>setFileName</B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> filename)
throws <A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">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.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>filename</CODE> - Filename to associate with 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 of this header
<DD><CODE><A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</A></CODE> - if this Part is obtained
from a READ_ONLY folder
<DD><CODE><A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></CODE></DL>
</DD>
</DL>
<HR>
<A NAME="getInputStream()"><!-- --></A><H3>
getInputStream</H3>
<PRE>
<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/io/InputStream.html?is-external=true" title="class or interface in java.io">InputStream</A> <B>getInputStream</B>()
throws <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A>,
<A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></PRE>
<DL>
<DD>Return an input stream for this part's "content". Any
mail-specific transfer encodings will be decoded before the
input stream is provided. <
p>
This is typically a convenience method that just invokes
the DataHandler's <code>getInputStream()</code> method.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>an InputStream
<DT><B>Throws:</B>
<DD><CODE><A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A></CODE> - this is typically thrown by the
DataHandler. Refer to the documentation for
javax.activation.DataHandler for more details.
<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#getDataHandler()"><CODE>getDataHandler()</CODE></A>,
<A HREF="http://java.sun.com/javase/technologies/desktop/javabeans/glasgow/javadocs/javax/activation/DataHandler.html?is-external=true#getInputStream()" title="class or interface in javax.activation"><CODE>DataHandler.getInputStream()</CODE></A></DL>
</DD>
</DL>
<HR>
<A NAME="getDataHandler()"><!-- --></A><H3>
getDataHandler</H3>
<PRE>
<A HREF="http://java.sun.com/javase/technologies/desktop/javabeans/glasgow/javadocs/javax/activation/DataHandler.html?is-external=true" title="class or interface in javax.activation">DataHandler</A> <B>getDataHandler</B>()
throws <A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></PRE>
<DL>
<DD>Return a DataHandler for the content within this part. The
DataHandler allows clients to operate on as well as retrieve
the content.
<P>
<DD><DL>
<DT><B>Returns:</B><DD>DataHandler for 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="getContent()"><!-- --></A><H3>
getContent</H3>
<PRE>
<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> <B>getContent</B>()
throws <A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException</A>,
<A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></PRE>
<DL>
<DD>Return the content as a Java object. The type of the returned
object is of course dependent on the content itself. For example,
the object returned for "text/plain" content is usually a String
object. The object returned for a "multipart" content is always a
Multipart subclass. For content-types that are unknown to the
DataHandler system, an input stream is returned as the content <p>
This is a convenience method that just invokes the DataHandler's
getContent() method
<
DD><
CODE><
A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException<
/A><
/CODE>
<
DD><
CODE><
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException<
/A><
/CODE> - this is typically thrown by the
DataHandler. Refer to the documentation for
javax.activation.DataHandler
for more details.<
DT><
B>See Also:<
/B><
DD><
A HREF="http://java.sun.com/javase/technologies/desktop/javabeans/glasgow/javadocs/javax/activation/DataHandler.html?is-external=true#getContent()" title="class or interface in javax.activation"><
CODE>DataHandler.getContent
()<
/CODE><
/A><
/DL>
<
A NAME="setDataHandler(javax.activation.DataHandler)"><!-- --><
/A><
H3>
void <
B>setDataHandler<
/B>
(<
A HREF="http://java.sun.com/javase/technologies/desktop/javabeans/glasgow/javadocs/javax/activation/DataHandler.html?is-external=true" title="class or interface in javax.activation">DataHandler<
/A> dh
)
throws <
A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException<
/A><
/PRE>
<
DD>This
method provides the mechanism to set this part
's content.
The DataHandler wraps around the actual content.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>dh</CODE> - The DataHandler for the content.
<DT><B>Throws:</B>
<DD><CODE><A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></CODE>
<DD><CODE><A HREF="../../javax/mail/IllegalWriteException.html" title="class in javax.mail">IllegalWriteException</A></CODE> - if the underlying implementation
does not support modification of existing values
<DD><CODE><A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException</A></CODE> - if this Part is obtained
from a READ_ONLY folder</DL>
</DD>
</DL>
<HR>
<A NAME="setContent(java.lang.Object, java.lang.String)"><!-- --></A><H3>
setContent</H3>
<PRE>
void <B>setContent</B>(<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</A> obj,
<A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</A> type)
throws <A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException</A></PRE>
<DL>
<DD>A convenience method for setting this part's content. The part
internally wraps the
content in a DataHandler. <
p>
Note that a DataContentHandler class for the specified type should
be available to the JavaMail implementation for this to work right.
i.e., to do <
code>setContent
(foobar,
"application/x-foobar")<
/code>,
a DataContentHandler for "application/x-foobar" should be installed.
Refer to the Java Activation Framework for more information.
<
DD><
CODE><
A HREF="../../javax/mail/IllegalWriteException.html" title="class in javax.mail">IllegalWriteException<
/A><
/CODE> - if the underlying implementation
does not support modification of existing values
<
DD><
CODE><
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException<
/A><
/CODE> - if this Part is obtained
from a READ_ONLY folder
<
DD><
CODE><
A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException<
/A><
/CODE><
/DL>
<
A NAME="setText(java.lang.String)"><!-- --><
/A><
H3>
void <
B>setText<
/B>
(<
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String<
/A>
text)
throws <
A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException<
/A><
/PRE>
<
DD>A convenience
method that sets the given String as this
part's content with a MIME type of "text/plain".
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>text</CODE> - The text that is the Message's content.
<
DD><
CODE><
A HREF="../../javax/mail/IllegalWriteException.html" title="class in javax.mail">IllegalWriteException<
/A><
/CODE> - if the underlying
implementation does not support modification of
existing values
<
DD><
CODE><
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException<
/A><
/CODE> - if this Part is obtained
from a READ_ONLY folder
<
DD><
CODE><
A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException<
/A><
/CODE><
/DL>
<
A NAME="setContent(javax.mail.Multipart)"><!-- --><
/A><
H3>
void <
B>setContent<
/B>
(<
A HREF="../../javax/mail/Multipart.html" title="class in javax.mail">Multipart<
/A> mp
)
throws <
A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException<
/A><
/PRE>
<
DD>This
method sets the given Multipart
object as this message
's
content.
<P>
<DD><DL>
<DT><B>Parameters:</B><DD><CODE>mp</CODE> - The multipart object that is the Message's content
<
DD><
CODE><
A HREF="../../javax/mail/IllegalWriteException.html" title="class in javax.mail">IllegalWriteException<
/A><
/CODE> - if the underlying
implementation does not support modification of
existing values
<
DD><
CODE><
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException<
/A><
/CODE> - if this Part is obtained
from a READ_ONLY folder
<
DD><
CODE><
A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException<
/A><
/CODE><
/DL>
<
A NAME="writeTo(java.io.OutputStream)"><!-- --><
/A><
H3>
void <
B>writeTo<
/B>
(<
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/io/OutputStream.html?is-external=true" title="class or interface in java.io">OutputStream<
/A> os
)
throws <
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException<
/A>,
<
A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException<
/A><
/PRE>
<
DD>Output a bytestream
for this Part. This bytestream is
typically an aggregration of the Part attributes and
an appropriately encoded bytestream from its
'content'. <
p>
Classes that implement the Part interface decide on
the appropriate encoding algorithm to be used. <
p>
The bytestream is typically used for sending.
<
DD><
CODE><
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/io/IOException.html?is-external=true" title="class or interface in java.io">IOException<
/A><
/CODE> - if an error occurs writing to the
stream or if an error is generated
by the javax.activation layer.
<
DD><
CODE><
A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException<
/A><
/CODE> - if an error occurs fetching the
data to be written<
DT><
B>See Also:<
/B><
DD><
A HREF="http://java.sun.com/javase/technologies/desktop/javabeans/glasgow/javadocs/javax/activation/DataHandler.html?is-external=true#writeTo(java.io.OutputStream)" title="class or interface in javax.activation"><
CODE>DataHandler.writeTo
(java.io.OutputStream
)<
/CODE><
/A><
/DL>
<
A NAME="getHeader(java.lang.String)"><!-- --><
/A><
H3>
<
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String<
/A>
[] <
B>getHeader<
/B>
(<
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String<
/A> header_name
)
throws <
A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException<
/A><
/PRE>
<
DD>Get all the
headers for this header
name. Returns <
code>null<
/code>
if no headers for this header name are available.
<
DT><
B>Parameters:<
/B><
DD><
CODE>header_name<
/CODE> - the
name of this header
<
DT><
B>Returns:<
/B><
DD>the
value fields
for all
headers with
this name
<
DD><
CODE><
A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException<
/A><
/CODE><
/DL>
<
A NAME="setHeader(java.lang.String, java.lang.String)"><!-- --><
/A><
H3>
void <
B>setHeader<
/B>
(<
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String<
/A> header_name,
<
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String<
/A> header_value
)
throws <
A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException<
/A><
/PRE>
<
DD>Set the
value for this header_name. Replaces all existing
header values with this new value.
<
DT><
B>Parameters:<
/B><
DD><
CODE>header_name<
/CODE> - the
name of this header<
DD><
CODE>header_value<
/CODE> - the
value for this header
<
DD><
CODE><
A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException<
/A><
/CODE>
<
DD><
CODE><
A HREF="../../javax/mail/IllegalWriteException.html" title="class in javax.mail">IllegalWriteException<
/A><
/CODE> - if the underlying
implementation does not support modification
of existing values
<
DD><
CODE><
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException<
/A><
/CODE> - if this Part is
obtained from a READ_ONLY folder<
/DL>
<
A NAME="addHeader(java.lang.String, java.lang.String)"><!-- --><
/A><
H3>
void <
B>addHeader<
/B>
(<
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String<
/A> header_name,
<
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String<
/A> header_value
)
throws <
A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException<
/A><
/PRE>
<
DD>Add this
value to the existing values
for this header_name.
<
DT><
B>Parameters:<
/B><
DD><
CODE>header_name<
/CODE> - the
name of this header<
DD><
CODE>header_value<
/CODE> - the
value for this header
<
DD><
CODE><
A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException<
/A><
/CODE>
<
DD><
CODE><
A HREF="../../javax/mail/IllegalWriteException.html" title="class in javax.mail">IllegalWriteException<
/A><
/CODE> - if the underlying
implementation does not support modification
of existing values
<
DD><
CODE><
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException<
/A><
/CODE> - if this Part is
obtained from a READ_ONLY folder<
/DL>
<
A NAME="removeHeader(java.lang.String)"><!-- --><
/A><
H3>
void <
B>removeHeader<
/B>
(<
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String<
/A> header_name
)
throws <
A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException<
/A><
/PRE>
<
DD>Remove all
headers with this
name.
<
DT><
B>Parameters:<
/B><
DD><
CODE>header_name<
/CODE> - the
name of this header
<
DD><
CODE><
A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException<
/A><
/CODE>
<
DD><
CODE><
A HREF="../../javax/mail/IllegalWriteException.html" title="class in javax.mail">IllegalWriteException<
/A><
/CODE> - if the underlying
implementation does not support modification
of existing values
<
DD><
CODE><
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/IllegalStateException.html?is-external=true" title="class or interface in java.lang">IllegalStateException<
/A><
/CODE> - if this Part is
obtained from a READ_ONLY folder<
/DL>
<
A NAME="getAllHeaders()"><!-- --><
/A><
H3>
<
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/util/Enumeration.html?is-external=true" title="class or interface in java.util">Enumeration<
/A> <
B>getAllHeaders<
/B>
()
throws <
A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException<
/A><
/PRE>
<
DD>Return all the
headers from this part as an Enumeration of
Header objects.
<
DT><
B>Returns:<
/B><
DD>enumeration of Header objects
<
DD><
CODE><
A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException<
/A><
/CODE><
/DL>
<
A NAME="getMatchingHeaders(java.lang.String[])"><!-- --><
/A><
H3>
<
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/util/Enumeration.html?is-external=true" title="class or interface in java.util">Enumeration<
/A> <
B>getMatchingHeaders<
/B>
(<
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String<
/A>
[] header_names
)
throws <
A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException<
/A><
/PRE>
<
DD>Return matching
headers from this part as an Enumeration of
Header objects.
<
DT><
B>Returns:<
/B><
DD>enumeration of Header objects
<
DD><
CODE><
A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException<
/A><
/CODE><
/DL>
<
A NAME="getNonMatchingHeaders(java.lang.String[])"><!-- --><
/A><
H3>
getNonMatchingHeaders<
/H3>
<
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/util/Enumeration.html?is-external=true" title="class or interface in java.util">Enumeration<
/A> <
B>getNonMatchingHeaders<
/B>
(<
A HREF="http://java.sun.com/j2se/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String<
/A>
[] header_names
)
throws <
A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException<
/A><
/PRE>
<
DD>Return non-matching
headers from this envelope as an Enumeration
of Header objects.
<
DT><
B>Returns:<
/B><
DD>enumeration of Header objects
<
DD><
CODE><
A HREF="../../javax/mail/MessagingException.html" title="class in javax.mail">MessagingException<
/A><
/CODE><
/DL>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<
A NAME="navbar_bottom"><!-- --><
/A>
<
A HREF="#skip-navbar_bottom" title="Skip navigation links"><
/A>
<
TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY="">
<
TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1">
<
A NAME="navbar_bottom_firstrow"><!-- --><
/A>
<
TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY="">
<
TR ALIGN="center" VALIGN="top">
<
TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <
A HREF="../../overview-summary.html"><
FONT CLASS="NavBarFont1"><
B>Overview<
/B><
/FONT><
/A> <
/TD>
<
TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <
A HREF="package-summary.html"><
FONT CLASS="NavBarFont1"><
B>Package<
/B><
/FONT><
/A> <
/TD>
<
TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <
FONT CLASS="NavBarFont1Rev"><
B>Class<
/B><
/FONT> <
/TD>
<
TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <
A HREF="class-use/Part.html"><
FONT CLASS="NavBarFont1"><
B>Use<
/B><
/FONT><
/A> <
/TD>
<
TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <
A HREF="package-tree.html"><
FONT CLASS="NavBarFont1"><
B>Tree<
/B><
/FONT><
/A> <
/TD>
<
TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <
A HREF="../../deprecated-list.html"><
FONT CLASS="NavBarFont1"><
B>Deprecated<
/B><
/FONT><
/A> <
/TD>
<
TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <
A HREF="../../index-files/index-1.html"><
FONT CLASS="NavBarFont1"><
B>Index<
/B><
/FONT><
/A> <
/TD>
<
TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <
A HREF="../../help-doc.html"><
FONT CLASS="NavBarFont1"><
B>Help<
/B><
/FONT><
/A> <
/TD>
<
TD ALIGN="right" VALIGN="top" ROWSPAN=3><
EM>
<
TD BGCOLOR="white" CLASS="NavBarCell2"><
FONT SIZE="-2">
<
A HREF="../../javax/mail/NoSuchProviderException.html" title="class in javax.mail"><
B>PREV CLASS<
/B><
/A>
<
A HREF="../../javax/mail/PasswordAuthentication.html" title="class in javax.mail"><
B>NEXT CLASS<
/B><
/A><
/FONT><
/TD>
<
TD BGCOLOR="white" CLASS="NavBarCell2"><
FONT SIZE="-2">
<
A HREF="../../index.html?javax/mail/Part.html" target="_top"><
B>FRAMES<
/B><
/A>
<
A HREF="Part.html" target="_top"><
B>NO FRAMES<
/B><
/A>
<
SCRIPT type="text/javascript">
<!--
if(window==top) {
document.writeln('<A HREF="../../allclasses-noframe.html"><B>All Classes</B></A>');
}
//-->
<
A HREF="../../allclasses-noframe.html"><
B>All Classes<
/B><
/A>
<
TD VALIGN="top" CLASS="NavBarCell3"><
FONT SIZE="-2">
SUMMARY: NESTED | <
A HREF="#field_summary">FIELD<
/A> | CONSTR | <
A HREF="#method_summary">METHOD<
/A><
/FONT><
/TD>
<
TD VALIGN="top" CLASS="NavBarCell3"><
FONT SIZE="-2">
DETAIL: <
A HREF="#field_detail">FIELD<
/A> | CONSTR | <
A HREF="#method_detail">METHOD<
/A><
/FONT><
/TD>
<
A NAME="skip-navbar_bottom"><
/A>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
Copyright &#
169;
2009 <
a href="http://www.sun.com">Sun Microsystems, Inc.<
/a>. All Rights Reserved.