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
protected static class SAAJMessage.SAAJAttachment extends Object implements AttachmentEx
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.sun.xml.ws.api.message.AttachmentEx
AttachmentEx.MimeHeader
-
-
Constructor Summary
Constructors Constructor Description SAAJAttachment(javax.xml.soap.AttachmentPart part)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description byte[]asByteArray()Gets the attachment as an exact-length byte array.javax.activation.DataHandlerasDataHandler()Gets the attachment as aDataHandler.InputStreamasInputStream()Obtains this attachment as anInputStream.SourceasSource()Gets the attachment as aSource.StringgetContentId()Content ID of the attachment.StringgetContentType()Gets the MIME content-type of this attachment.Iterator<AttachmentEx.MimeHeader>getMimeHeaders()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.
-
-
-
Method Detail
-
getContentId
public String 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
public String 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
public Source asSource()
Gets the attachment as aSource. Note that there's no guarantee that the attachment is actually an XML.- Specified by:
asSourcein interfaceAttachment
-
asInputStream
public InputStream asInputStream()
Obtains this attachment as anInputStream.- Specified by:
asInputStreamin interfaceAttachment
-
writeTo
public void writeTo(OutputStream os) throws IOException
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
public Iterator<AttachmentEx.MimeHeader> getMimeHeaders()
Description copied from interface:AttachmentExIterator of custom MIME headers associated with this attachment- Specified by:
getMimeHeadersin interfaceAttachmentEx- Returns:
- MIME header iterator
-
-