Package com.sun.xml.ws.message.saaj
Class SAAJMessage.SAAJAttachment
java.lang.Object
com.sun.xml.ws.message.saaj.SAAJMessage.SAAJAttachment
- All Implemented Interfaces:
Attachment,AttachmentEx
- Enclosing class:
- SAAJMessage
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.sun.xml.ws.api.message.AttachmentEx
AttachmentEx.MimeHeader -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbyte[]Gets the attachment as an exact-length byte array.javax.activation.DataHandlerGets the attachment as aDataHandler.Obtains this attachment as anInputStream.asSource()Gets the attachment as aSource.Content ID of the attachment.Gets the MIME content-type of this attachment.Iterator of custom MIME headers associated with this attachmentvoidwriteTo(OutputStream os) Writes the contents of the attachment into the given stream.voidwriteTo(javax.xml.soap.SOAPMessage saaj) Writes this attachment to the givenSOAPMessage.
-
Constructor Details
-
SAAJAttachment
public SAAJAttachment(javax.xml.soap.AttachmentPart part)
-
-
Method Details
-
getContentId
Content ID of the attachment. Uniquely identifies an attachment.- Specified by:
getContentIdin interfaceAttachment- Returns:
- The content ID like "foo-bar-zot@abc.com", without surrounding '<' and '>' used as the transfer syntax.
-
getContentType
Gets the MIME content-type of this attachment.- Specified by:
getContentTypein interfaceAttachment
-
asByteArray
public byte[] asByteArray()Gets the attachment as an exact-length byte array.- Specified by:
asByteArrayin interfaceAttachment
-
asDataHandler
public javax.activation.DataHandler asDataHandler()Gets the attachment as aDataHandler.- Specified by:
asDataHandlerin interfaceAttachment
-
asSource
Gets the attachment as aSource. Note that there's no guarantee that the attachment is actually an XML.- Specified by:
asSourcein interfaceAttachment
-
asInputStream
Obtains this attachment as anInputStream.- Specified by:
asInputStreamin interfaceAttachment
-
writeTo
Writes the contents of the attachment into the given stream.- Specified by:
writeToin interfaceAttachment- Throws:
IOException
-
writeTo
public void writeTo(javax.xml.soap.SOAPMessage saaj) Writes this attachment to the givenSOAPMessage.- Specified by:
writeToin interfaceAttachment
-
getMimeHeaders
Description copied from interface:AttachmentExIterator of custom MIME headers associated with this attachment- Specified by:
getMimeHeadersin interfaceAttachmentEx- Returns:
- MIME header iterator
-