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.jakarta.activation.DataHandler
Gets 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 attachmentvoid
writeTo
(jakarta.xml.soap.SOAPMessage saaj) Writes this attachment to the givenSOAPMessage
.void
writeTo
(OutputStream os) Writes the contents of the attachment into the given stream.
-
Constructor Details
-
SAAJAttachment
public SAAJAttachment(jakarta.xml.soap.AttachmentPart part)
-
-
Method Details
-
getContentId
Content ID of the attachment. Uniquely identifies an attachment.- Specified by:
getContentId
in interfaceAttachment
- Returns:
- The content ID like "[email protected]", without surrounding '<' and '>' used as the transfer syntax.
-
getContentType
Gets the MIME content-type of this attachment.- Specified by:
getContentType
in interfaceAttachment
-
asByteArray
public byte[] asByteArray()Gets the attachment as an exact-length byte array.- Specified by:
asByteArray
in interfaceAttachment
-
asDataHandler
public jakarta.activation.DataHandler asDataHandler()Gets the attachment as aDataHandler
.- Specified by:
asDataHandler
in interfaceAttachment
-
asSource
Gets the attachment as aSource
. Note that there's no guarantee that the attachment is actually an XML.- Specified by:
asSource
in interfaceAttachment
-
asInputStream
Obtains this attachment as anInputStream
.- Specified by:
asInputStream
in interfaceAttachment
-
writeTo
Writes the contents of the attachment into the given stream.- Specified by:
writeTo
in interfaceAttachment
- Throws:
IOException
-
writeTo
public void writeTo(jakarta.xml.soap.SOAPMessage saaj) Writes this attachment to the givenSOAPMessage
.- Specified by:
writeTo
in interfaceAttachment
-
getMimeHeaders
Description copied from interface:AttachmentEx
Iterator of custom MIME headers associated with this attachment- Specified by:
getMimeHeaders
in interfaceAttachmentEx
- Returns:
- MIME header iterator
-