blob: 38bce1669b59906e449156351caae50a16769229 [file] [log] [blame]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<!-- NewPage -->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>AttachmentPart (Apache Axis)</title>
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
</head>
<body>
<script type="text/javascript"><!--
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="AttachmentPart (Apache Axis)";
}
//-->
</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a name="navbar_top">
<!-- -->
</a><a href="#skip-navbar_top" title="Skip navigation links"></a><a name="navbar_top_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/AttachmentPart.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-all.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev Class</li>
<li><a href="../../../javax/xml/soap/Detail.html" title="interface in javax.xml.soap"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?javax/xml/soap/AttachmentPart.html" target="_top">Frames</a></li>
<li><a href="AttachmentPart.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_top">
<li><a href="../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_top");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_top">
<!-- -->
</a></div>
<!-- ========= END OF TOP NAVBAR ========= -->
<!-- ======== START OF CLASS DATA ======== -->
<div class="header">
<div class="subTitle">javax.xml.soap</div>
<h2 title="Class AttachmentPart" class="title">Class AttachmentPart</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>javax.xml.soap.AttachmentPart</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>Direct Known Subclasses:</dt>
<dd><a href="../../../org/apache/axis/attachments/AttachmentPart.html" title="class in org.apache.axis.attachments">AttachmentPart</a></dd>
</dl>
<hr>
<br>
<pre>public abstract class <span class="strong">AttachmentPart</span>
extends <a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></pre>
<div class="block"><P>A single attachment to a <CODE>SOAPMessage</CODE> object. A
<CODE>SOAPMessage</CODE> object may contain zero, one, or many
<CODE>AttachmentPart</CODE> objects. Each <CODE>
AttachmentPart</CODE> object consists of two parts,
application-specific content and associated MIME headers. The
MIME headers consists of name/value pairs that can be used to
identify and describe the content.</P>
<P>An <CODE>AttachmentPart</CODE> object must conform to
certain standards.</P>
<OL>
<LI>It must conform to <A href=
"http://www.ietf.org/rfc/rfc2045.txt">MIME [RFC2045]
standards</A></LI>
<LI>It MUST contain content</LI>
<LI>
The header portion MUST include the following header:
<UL>
<LI>
<CODE>Content-Type</CODE><BR>
This header identifies the type of data in the content
of an <CODE>AttachmentPart</CODE> object and MUST
conform to [RFC2045]. The following is an example of a
Content-Type header:
<PRE>
Content-Type: application/xml
</PRE>
The following line of code, in which <CODE>ap</CODE> is
an <CODE>AttachmentPart</CODE> object, sets the header
shown in the previous example.
<PRE>
ap.setMimeHeader("Content-Type", "application/xml");
</PRE>
<P></P>
</LI>
</UL>
</LI>
</OL>
<P>There are no restrictions on the content portion of an
<CODE>AttachmentPart</CODE> object. The content may be anything
from a simple plain text object to a complex XML document or
image file.</P>
<P>An <CODE>AttachmentPart</CODE> object is created with the
method <CODE>SOAPMessage.createAttachmentPart</CODE>. After
setting its MIME headers, the <CODE>AttachmentPart</CODE>
object is added to the message that created it with the method
<CODE>SOAPMessage.addAttachmentPart</CODE>.</P>
<P>The following code fragment, in which <CODE>m</CODE> is a
<CODE>SOAPMessage</CODE> object and <CODE>contentStringl</CODE>
is a <CODE>String</CODE>, creates an instance of <CODE>
AttachmentPart</CODE>, sets the <CODE>AttachmentPart</CODE>
object with some content and header information, and adds the
<CODE>AttachmentPart</CODE> object to the <CODE>
SOAPMessage</CODE> object.</P>
<PRE>
AttachmentPart ap1 = m.createAttachmentPart();
ap1.setContent(contentString1, "text/plain");
m.addAttachmentPart(ap1);
</PRE>
<P>The following code fragment creates and adds a second <CODE>
AttachmentPart</CODE> instance to the same message. <CODE>
jpegData</CODE> is a binary byte buffer representing the jpeg
file.</P>
<PRE>
AttachmentPart ap2 = m.createAttachmentPart();
byte[] jpegData = ...;
ap2.setContent(new ByteArrayInputStream(jpegData), "image/jpeg");
m.addAttachmentPart(ap2);
</PRE>
<P>The <CODE>getContent</CODE> method retrieves the contents
and header from an <CODE>AttachmentPart</CODE> object.
Depending on the <CODE>DataContentHandler</CODE> objects
present, the returned <CODE>Object</CODE> can either be a typed
Java object corresponding to the MIME type or an <CODE>
InputStream</CODE> object that contains the content as
bytes.</P>
<PRE>
String content1 = ap1.getContent();
java.io.InputStream content2 = ap2.getContent();
</PRE>
The method <CODE>clearContent</CODE> removes all the content
from an <CODE>AttachmentPart</CODE> object but does not affect
its header information.
<PRE>
ap1.clearContent();
</PRE></div>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_summary">
<!-- -->
</a>
<h3>Constructor Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Constructor Summary table, listing constructors, and an explanation">
<caption><span>Constructors</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colOne" scope="col">Constructor and Description</th>
</tr>
<tr class="altColor">
<td class="colOne"><code><strong><a href="../../../javax/xml/soap/AttachmentPart.html#AttachmentPart()">AttachmentPart</a></strong>()</code>
<div class="block">Create a new AttachmentPart.</div>
</td>
</tr>
</table>
</li>
</ul>
<!-- ========== METHOD SUMMARY =========== -->
<ul class="blockList">
<li class="blockList"><a name="method_summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<table class="overviewSummary" border="0" cellpadding="3" cellspacing="0" summary="Method Summary table, listing methods, and an explanation">
<caption><span>Methods</span><span class="tabEnd">&nbsp;</span></caption>
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colLast" scope="col">Method and Description</th>
</tr>
<tr class="altColor">
<td class="colFirst"><code>abstract void</code></td>
<td class="colLast"><code><strong><a href="../../../javax/xml/soap/AttachmentPart.html#addMimeHeader(java.lang.String,%20java.lang.String)">addMimeHeader</a></strong>(<a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name,
<a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;value)</code>
<div class="block">Adds a MIME header with the specified name and value to
this <CODE>AttachmentPart</CODE> object.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>abstract void</code></td>
<td class="colLast"><code><strong><a href="../../../javax/xml/soap/AttachmentPart.html#clearContent()">clearContent</a></strong>()</code>
<div class="block">Clears out the content of this <CODE>
AttachmentPart</CODE> object.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>abstract <a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/util/Iterator.html?is-external=true" title="class or interface in java.util">Iterator</a></code></td>
<td class="colLast"><code><strong><a href="../../../javax/xml/soap/AttachmentPart.html#getAllMimeHeaders()">getAllMimeHeaders</a></strong>()</code>
<div class="block">Retrieves all the headers for this <CODE>
AttachmentPart</CODE> object as an iterator over the <CODE>
MimeHeader</CODE> objects.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>abstract <a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></code></td>
<td class="colLast"><code><strong><a href="../../../javax/xml/soap/AttachmentPart.html#getContent()">getContent</a></strong>()</code>
<div class="block">Gets the content of this <code>AttachmentPart</code> object as a Java
object.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../javax/xml/soap/AttachmentPart.html#getContentId()">getContentId</a></strong>()</code>
<div class="block">Gets the value of the MIME header whose name is
"Content-Id".</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../javax/xml/soap/AttachmentPart.html#getContentLocation()">getContentLocation</a></strong>()</code>
<div class="block">Gets the value of the MIME header
"Content-Location".</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code><a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a></code></td>
<td class="colLast"><code><strong><a href="../../../javax/xml/soap/AttachmentPart.html#getContentType()">getContentType</a></strong>()</code>
<div class="block">Gets the value of the MIME header "Content-Type".</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>abstract <a href="http://download.oracle.com/javaee/1.4/api/javax/activation/DataHandler.html?is-external=true" title="class or interface in javax.activation">DataHandler</a></code></td>
<td class="colLast"><code><strong><a href="../../../javax/xml/soap/AttachmentPart.html#getDataHandler()">getDataHandler</a></strong>()</code>
<div class="block">Gets the <CODE>DataHandler</CODE> object for this <CODE>
AttachmentPart</CODE> object.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>abstract <a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/util/Iterator.html?is-external=true" title="class or interface in java.util">Iterator</a></code></td>
<td class="colLast"><code><strong><a href="../../../javax/xml/soap/AttachmentPart.html#getMatchingMimeHeaders(java.lang.String[])">getMatchingMimeHeaders</a></strong>(<a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[]&nbsp;names)</code>
<div class="block">Retrieves all <CODE>MimeHeader</CODE> objects that match
a name in the given array.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>abstract <a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[]</code></td>
<td class="colLast"><code><strong><a href="../../../javax/xml/soap/AttachmentPart.html#getMimeHeader(java.lang.String)">getMimeHeader</a></strong>(<a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name)</code>
<div class="block">Gets all the values of the header identified by the given
<CODE>String</CODE>.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>abstract <a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/util/Iterator.html?is-external=true" title="class or interface in java.util">Iterator</a></code></td>
<td class="colLast"><code><strong><a href="../../../javax/xml/soap/AttachmentPart.html#getNonMatchingMimeHeaders(java.lang.String[])">getNonMatchingMimeHeaders</a></strong>(<a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[]&nbsp;names)</code>
<div class="block">Retrieves all <CODE>MimeHeader</CODE> objects whose name
does not match a name in the given array.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>abstract int</code></td>
<td class="colLast"><code><strong><a href="../../../javax/xml/soap/AttachmentPart.html#getSize()">getSize</a></strong>()</code>
<div class="block">Returns the number of bytes in this <CODE>
AttachmentPart</CODE> object.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>abstract void</code></td>
<td class="colLast"><code><strong><a href="../../../javax/xml/soap/AttachmentPart.html#removeAllMimeHeaders()">removeAllMimeHeaders</a></strong>()</code>
<div class="block">Removes all the MIME header entries.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>abstract void</code></td>
<td class="colLast"><code><strong><a href="../../../javax/xml/soap/AttachmentPart.html#removeMimeHeader(java.lang.String)">removeMimeHeader</a></strong>(<a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;header)</code>
<div class="block">Removes all MIME headers that match the given name.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>abstract void</code></td>
<td class="colLast"><code><strong><a href="../../../javax/xml/soap/AttachmentPart.html#setContent(java.lang.Object,%20java.lang.String)">setContent</a></strong>(<a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;object,
<a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;contentType)</code>
<div class="block">Sets the content of this attachment part to that of the
given <CODE>Object</CODE> and sets the value of the <CODE>
Content-Type</CODE> header to the given type.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../javax/xml/soap/AttachmentPart.html#setContentId(java.lang.String)">setContentId</a></strong>(<a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;contentId)</code>
<div class="block">Sets the MIME header "Content-Id" with the given
value.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../javax/xml/soap/AttachmentPart.html#setContentLocation(java.lang.String)">setContentLocation</a></strong>(<a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;contentLocation)</code>
<div class="block">Sets the MIME header "Content-Location" with the given
value.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>void</code></td>
<td class="colLast"><code><strong><a href="../../../javax/xml/soap/AttachmentPart.html#setContentType(java.lang.String)">setContentType</a></strong>(<a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;contentType)</code>
<div class="block">Sets the MIME header "Content-Type" with the given
value.</div>
</td>
</tr>
<tr class="altColor">
<td class="colFirst"><code>abstract void</code></td>
<td class="colLast"><code><strong><a href="../../../javax/xml/soap/AttachmentPart.html#setDataHandler(javax.activation.DataHandler)">setDataHandler</a></strong>(<a href="http://download.oracle.com/javaee/1.4/api/javax/activation/DataHandler.html?is-external=true" title="class or interface in javax.activation">DataHandler</a>&nbsp;datahandler)</code>
<div class="block">Sets the given <CODE>DataHandler</CODE> object as the
data handler for this <CODE>AttachmentPart</CODE> object.</div>
</td>
</tr>
<tr class="rowColor">
<td class="colFirst"><code>abstract void</code></td>
<td class="colLast"><code><strong><a href="../../../javax/xml/soap/AttachmentPart.html#setMimeHeader(java.lang.String,%20java.lang.String)">setMimeHeader</a></strong>(<a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name,
<a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;value)</code>
<div class="block">Changes the first header entry that matches the given name
to the given value, adding a new header if no existing
header matches.</div>
</td>
</tr>
</table>
<ul class="blockList">
<li class="blockList"><a name="methods_inherited_from_class_java.lang.Object">
<!-- -->
</a>
<h3>Methods inherited from class&nbsp;java.lang.<a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a></h3>
<code><a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/Object.html?is-external=true#clone()" title="class or interface in java.lang">clone</a>, <a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/Object.html?is-external=true#equals(java.lang.Object)" title="class or interface in java.lang">equals</a>, <a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/Object.html?is-external=true#finalize()" title="class or interface in java.lang">finalize</a>, <a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/Object.html?is-external=true#getClass()" title="class or interface in java.lang">getClass</a>, <a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/Object.html?is-external=true#hashCode()" title="class or interface in java.lang">hashCode</a>, <a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/Object.html?is-external=true#notify()" title="class or interface in java.lang">notify</a>, <a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/Object.html?is-external=true#notifyAll()" title="class or interface in java.lang">notifyAll</a>, <a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/Object.html?is-external=true#toString()" title="class or interface in java.lang">toString</a>, <a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/Object.html?is-external=true#wait()" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/Object.html?is-external=true#wait(long)" title="class or interface in java.lang">wait</a>, <a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/Object.html?is-external=true#wait(long,%20int)" title="class or interface in java.lang">wait</a></code></li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ========= CONSTRUCTOR DETAIL ======== -->
<ul class="blockList">
<li class="blockList"><a name="constructor_detail">
<!-- -->
</a>
<h3>Constructor Detail</h3>
<a name="AttachmentPart()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>AttachmentPart</h4>
<pre>public&nbsp;AttachmentPart()</pre>
<div class="block">Create a new AttachmentPart.</div>
</li>
</ul>
</li>
</ul>
<!-- ============ METHOD DETAIL ========== -->
<ul class="blockList">
<li class="blockList"><a name="method_detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a name="getSize()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSize</h4>
<pre>public abstract&nbsp;int&nbsp;getSize()
throws <a href="../../../javax/xml/soap/SOAPException.html" title="class in javax.xml.soap">SOAPException</a></pre>
<div class="block">Returns the number of bytes in this <CODE>
AttachmentPart</CODE> object.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>the size of this <CODE>AttachmentPart</CODE> object
in bytes or -1 if the size cannot be determined</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../javax/xml/soap/SOAPException.html" title="class in javax.xml.soap">SOAPException</a></code> - if the content of this
attachment is corrupted of if there was an exception
while trying to determine the size.</dd></dl>
</li>
</ul>
<a name="clearContent()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>clearContent</h4>
<pre>public abstract&nbsp;void&nbsp;clearContent()</pre>
<div class="block">Clears out the content of this <CODE>
AttachmentPart</CODE> object. The MIME header portion is left
untouched.</div>
</li>
</ul>
<a name="getContent()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getContent</h4>
<pre>public abstract&nbsp;<a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;getContent()
throws <a href="../../../javax/xml/soap/SOAPException.html" title="class in javax.xml.soap">SOAPException</a></pre>
<div class="block">Gets the content of this <code>AttachmentPart</code> object as a Java
object. The type of the returned Java object depends on (1) the
<code>DataContentHandler</code> object that is used to interpret the bytes
and (2) the <code>Content-Type</code> given in the header.
<p>
For the MIME content types "text/plain", "text/html" and "text/xml", the
<code>DataContentHandler</code> object does the conversions to and
from the Java types corresponding to the MIME types.
For other MIME types,the <code>DataContentHandler</code> object
can return an <code>InputStream</code> object that contains the content data
as raw bytes.
<p>
A JAXM-compliant implementation must, as a minimum, return a
<code>java.lang.String</code> object corresponding to any content
stream with a <code>Content-Type</code> value of
<code>text/plain</code>, a
<code>javax.xml.transform.StreamSource</code> object corresponding to a
content stream with a <code>Content-Type</code> value of
<code>text/xml</code>, a <code>java.awt.Image</code> object
corresponding to a content stream with a
<code>Content-Type</code> value of <code>image/gif</code> or
<code>image/jpeg</code>. For those content types that an
installed <code>DataContentHandler</code> object does not understand, the
<code>DataContentHandler</code> object is required to return a
<code>java.io.InputStream</code> object with the raw bytes.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>a Java object with the content of this <CODE>
AttachmentPart</CODE> object</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../javax/xml/soap/SOAPException.html" title="class in javax.xml.soap">SOAPException</a></code> - if there is no content set
into this <CODE>AttachmentPart</CODE> object or if there
was a data transformation error</dd></dl>
</li>
</ul>
<a name="setContent(java.lang.Object, java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setContent</h4>
<pre>public abstract&nbsp;void&nbsp;setContent(<a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/Object.html?is-external=true" title="class or interface in java.lang">Object</a>&nbsp;object,
<a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;contentType)</pre>
<div class="block">Sets the content of this attachment part to that of the
given <CODE>Object</CODE> and sets the value of the <CODE>
Content-Type</CODE> header to the given type. The type of the
<CODE>Object</CODE> should correspond to the value given for
the <CODE>Content-Type</CODE>. This depends on the particular
set of <CODE>DataContentHandler</CODE> objects in use.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>object</code> - the Java object that makes up
the content for this attachment part</dd><dd><code>contentType</code> - the MIME string that
specifies the type of the content</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if
the contentType does not match the type of the content
object, or if there was no <CODE>
DataContentHandler</CODE> object for this content
object</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../javax/xml/soap/AttachmentPart.html#getContent()"><code>getContent()</code></a></dd></dl>
</li>
</ul>
<a name="getDataHandler()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getDataHandler</h4>
<pre>public abstract&nbsp;<a href="http://download.oracle.com/javaee/1.4/api/javax/activation/DataHandler.html?is-external=true" title="class or interface in javax.activation">DataHandler</a>&nbsp;getDataHandler()
throws <a href="../../../javax/xml/soap/SOAPException.html" title="class in javax.xml.soap">SOAPException</a></pre>
<div class="block">Gets the <CODE>DataHandler</CODE> object for this <CODE>
AttachmentPart</CODE> object.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>the <CODE>DataHandler</CODE> object associated with
this <CODE>AttachmentPart</CODE> object</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="../../../javax/xml/soap/SOAPException.html" title="class in javax.xml.soap">SOAPException</a></code> - if there is
no data in this <CODE>AttachmentPart</CODE> object</dd></dl>
</li>
</ul>
<a name="setDataHandler(javax.activation.DataHandler)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setDataHandler</h4>
<pre>public abstract&nbsp;void&nbsp;setDataHandler(<a href="http://download.oracle.com/javaee/1.4/api/javax/activation/DataHandler.html?is-external=true" title="class or interface in javax.activation">DataHandler</a>&nbsp;datahandler)</pre>
<div class="block">Sets the given <CODE>DataHandler</CODE> object as the
data handler for this <CODE>AttachmentPart</CODE> object.
Typically, on an incoming message, the data handler is
automatically set. When a message is being created and
populated with content, the <CODE>setDataHandler</CODE>
method can be used to get data from various data sources into
the message.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>datahandler</code> - <CODE>DataHandler</CODE> object to
be set</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if
there was a problem with the specified <CODE>
DataHandler</CODE> object</dd></dl>
</li>
</ul>
<a name="getContentId()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getContentId</h4>
<pre>public&nbsp;<a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;getContentId()</pre>
<div class="block">Gets the value of the MIME header whose name is
"Content-Id".</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>a <CODE>String</CODE> giving the value of the
"Content-Id" header or <CODE>null</CODE> if there is
none</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../javax/xml/soap/AttachmentPart.html#setContentId(java.lang.String)"><code>setContentId(java.lang.String)</code></a></dd></dl>
</li>
</ul>
<a name="getContentLocation()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getContentLocation</h4>
<pre>public&nbsp;<a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;getContentLocation()</pre>
<div class="block">Gets the value of the MIME header
"Content-Location".</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>a <CODE>String</CODE> giving the value of the
"Content-Location" header or <CODE>null</CODE> if there
is none</dd></dl>
</li>
</ul>
<a name="getContentType()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getContentType</h4>
<pre>public&nbsp;<a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;getContentType()</pre>
<div class="block">Gets the value of the MIME header "Content-Type".</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>a <CODE>String</CODE> giving the value of the
"Content-Type" header or <CODE>null</CODE> if there is
none</dd></dl>
</li>
</ul>
<a name="setContentId(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setContentId</h4>
<pre>public&nbsp;void&nbsp;setContentId(<a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;contentId)</pre>
<div class="block">Sets the MIME header "Content-Id" with the given
value.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>contentId</code> - a <CODE>String</CODE> giving
the value of the "Content-Id" header</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if
there was a problem with the specified <CODE>
contentId</CODE> value</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../javax/xml/soap/AttachmentPart.html#getContentId()"><code>getContentId()</code></a></dd></dl>
</li>
</ul>
<a name="setContentLocation(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setContentLocation</h4>
<pre>public&nbsp;void&nbsp;setContentLocation(<a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;contentLocation)</pre>
<div class="block">Sets the MIME header "Content-Location" with the given
value.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>contentLocation</code> - a <CODE>String</CODE>
giving the value of the "Content-Location" header</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if
there was a problem with the specified content
location</dd></dl>
</li>
</ul>
<a name="setContentType(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setContentType</h4>
<pre>public&nbsp;void&nbsp;setContentType(<a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;contentType)</pre>
<div class="block">Sets the MIME header "Content-Type" with the given
value.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>contentType</code> - a <CODE>String</CODE>
giving the value of the "Content-Type" header</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if
there was a problem with the specified content type</dd></dl>
</li>
</ul>
<a name="removeMimeHeader(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>removeMimeHeader</h4>
<pre>public abstract&nbsp;void&nbsp;removeMimeHeader(<a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;header)</pre>
<div class="block">Removes all MIME headers that match the given name.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>header</code> - - the string name of the MIME
header/s to be removed</dd></dl>
</li>
</ul>
<a name="removeAllMimeHeaders()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>removeAllMimeHeaders</h4>
<pre>public abstract&nbsp;void&nbsp;removeAllMimeHeaders()</pre>
<div class="block">Removes all the MIME header entries.</div>
</li>
</ul>
<a name="getMimeHeader(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMimeHeader</h4>
<pre>public abstract&nbsp;<a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[]&nbsp;getMimeHeader(<a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name)</pre>
<div class="block">Gets all the values of the header identified by the given
<CODE>String</CODE>.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>name</code> - the name of the header; example:
"Content-Type"</dd>
<dt><span class="strong">Returns:</span></dt><dd>a <CODE>String</CODE> array giving the value for the
specified header</dd><dt><span class="strong">See Also:</span></dt><dd><a href="../../../javax/xml/soap/AttachmentPart.html#setMimeHeader(java.lang.String,%20java.lang.String)"><code>setMimeHeader(java.lang.String, java.lang.String)</code></a></dd></dl>
</li>
</ul>
<a name="setMimeHeader(java.lang.String, java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>setMimeHeader</h4>
<pre>public abstract&nbsp;void&nbsp;setMimeHeader(<a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name,
<a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;value)</pre>
<div class="block">Changes the first header entry that matches the given name
to the given value, adding a new header if no existing
header matches. This method also removes all matching
headers but the first.
<P>Note that RFC822 headers can only contain US-ASCII
characters.</P></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>name</code> - a <CODE>String</CODE> giving the
name of the header for which to search</dd><dd><code>value</code> - a <CODE>String</CODE> giving the
value to be set for the header whose name matches the
given name</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if
there was a problem with the specified mime header name
or value</dd></dl>
</li>
</ul>
<a name="addMimeHeader(java.lang.String, java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>addMimeHeader</h4>
<pre>public abstract&nbsp;void&nbsp;addMimeHeader(<a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;name,
<a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>&nbsp;value)</pre>
<div class="block">Adds a MIME header with the specified name and value to
this <CODE>AttachmentPart</CODE> object.
<P>Note that RFC822 headers can contain only US-ASCII
characters.</P></div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>name</code> - a <CODE>String</CODE> giving the
name of the header to be added</dd><dd><code>value</code> - a <CODE>String</CODE> giving the
value of the header to be added</dd>
<dt><span class="strong">Throws:</span></dt>
<dd><code><a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/IllegalArgumentException.html?is-external=true" title="class or interface in java.lang">IllegalArgumentException</a></code> - if
there was a problem with the specified mime header name
or value</dd></dl>
</li>
</ul>
<a name="getAllMimeHeaders()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getAllMimeHeaders</h4>
<pre>public abstract&nbsp;<a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/util/Iterator.html?is-external=true" title="class or interface in java.util">Iterator</a>&nbsp;getAllMimeHeaders()</pre>
<div class="block">Retrieves all the headers for this <CODE>
AttachmentPart</CODE> object as an iterator over the <CODE>
MimeHeader</CODE> objects.</div>
<dl><dt><span class="strong">Returns:</span></dt><dd>an <CODE>Iterator</CODE> object with all of the Mime
headers for this <CODE>AttachmentPart</CODE> object</dd></dl>
</li>
</ul>
<a name="getMatchingMimeHeaders(java.lang.String[])">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getMatchingMimeHeaders</h4>
<pre>public abstract&nbsp;<a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/util/Iterator.html?is-external=true" title="class or interface in java.util">Iterator</a>&nbsp;getMatchingMimeHeaders(<a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[]&nbsp;names)</pre>
<div class="block">Retrieves all <CODE>MimeHeader</CODE> objects that match
a name in the given array.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>names</code> - a <CODE>String</CODE> array with
the name(s) of the MIME headers to be returned</dd>
<dt><span class="strong">Returns:</span></dt><dd>all of the MIME headers that match one of the names
in the given array as an <CODE>Iterator</CODE>
object</dd></dl>
</li>
</ul>
<a name="getNonMatchingMimeHeaders(java.lang.String[])">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getNonMatchingMimeHeaders</h4>
<pre>public abstract&nbsp;<a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/util/Iterator.html?is-external=true" title="class or interface in java.util">Iterator</a>&nbsp;getNonMatchingMimeHeaders(<a href="http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/String.html?is-external=true" title="class or interface in java.lang">String</a>[]&nbsp;names)</pre>
<div class="block">Retrieves all <CODE>MimeHeader</CODE> objects whose name
does not match a name in the given array.</div>
<dl><dt><span class="strong">Parameters:</span></dt><dd><code>names</code> - a <CODE>String</CODE> array with
the name(s) of the MIME headers not to be returned</dd>
<dt><span class="strong">Returns:</span></dt><dd>all of the MIME headers in this <CODE>
AttachmentPart</CODE> object except those that match one
of the names in the given array. The nonmatching MIME
headers are returned as an <CODE>Iterator</CODE>
object.</dd></dl>
</li>
</ul>
</li>
</ul>
</li>
</ul>
</div>
</div>
<!-- ========= END OF CLASS DATA ========= -->
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a name="navbar_bottom">
<!-- -->
</a><a href="#skip-navbar_bottom" title="Skip navigation links"></a><a name="navbar_bottom_firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../overview-summary.html">Overview</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/AttachmentPart.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-all.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
</div>
<div class="subNav">
<ul class="navList">
<li>Prev Class</li>
<li><a href="../../../javax/xml/soap/Detail.html" title="interface in javax.xml.soap"><span class="strong">Next Class</span></a></li>
</ul>
<ul class="navList">
<li><a href="../../../index.html?javax/xml/soap/AttachmentPart.html" target="_top">Frames</a></li>
<li><a href="AttachmentPart.html" target="_top">No Frames</a></li>
</ul>
<ul class="navList" id="allclasses_navbar_bottom">
<li><a href="../../../allclasses-noframe.html">All Classes</a></li>
</ul>
<div>
<script type="text/javascript"><!--
allClassesLink = document.getElementById("allclasses_navbar_bottom");
if(window==top) {
allClassesLink.style.display = "block";
}
else {
allClassesLink.style.display = "none";
}
//-->
</script>
</div>
<div>
<ul class="subNavList">
<li>Summary:&nbsp;</li>
<li>Nested&nbsp;|&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_summary">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail:&nbsp;</li>
<li>Field&nbsp;|&nbsp;</li>
<li><a href="#constructor_detail">Constr</a>&nbsp;|&nbsp;</li>
<li><a href="#method_detail">Method</a></li>
</ul>
</div>
<a name="skip-navbar_bottom">
<!-- -->
</a></div>
<!-- ======== END OF BOTTOM NAVBAR ======= -->
<p class="legalCopy"><small>Copyright © <a href="http://www.apache.org/">The Apache Software Foundation</a>. All Rights Reserved.</small></p>
</body>
</html>