java.lang.Object
com.sun.xml.ws.message.ByteArrayAttachment
- All Implemented Interfaces:
Attachment
- Author:
- Jitendra Kotamraju
-
Constructor Summary
ConstructorsConstructorDescriptionByteArrayAttachment
(String contentId, byte[] data, int start, int len, String mimeType) ByteArrayAttachment
(String contentId, byte[] data, String mimeType) -
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.void
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
-
ByteArrayAttachment
-
ByteArrayAttachment
-
-
Method Details
-
getContentId
Description copied from interface:Attachment
Content ID of the attachment. Uniquely identifies an attachment. http://www.ietf.org/rfc/rfc2392.txt (which is referred by the ws-i attachment profile http://www.ws-i.org/Profiles/AttachmentsProfile-1.0.html) content-id = url-addr-spec url-addr-spec = addr-spec ; URL encoding of RFC 822 addr-spec cid-url = "cid" ":" content-id A "cid" URL is converted to the corresponding Content-ID message header [MIME] by removing the "cid:" prefix, converting the % encoded character to their equivalent US-ASCII characters, and enclosing the remaining parts with an angle bracket pair, "<" and ">". For example, "cid:foo4%[email protected]" corresponds to Content-ID: <foo4%[email protected]>- Specified by:
getContentId
in interfaceAttachment
- Returns:
- The content ID like "[email protected]", without surrounding '<' and '>' used as the transfer syntax.
-
getContentType
Description copied from interface:Attachment
Gets the MIME content-type of this attachment.- Specified by:
getContentType
in interfaceAttachment
-
asByteArray
public byte[] asByteArray()Description copied from interface:Attachment
Gets the attachment as an exact-length byte array.- Specified by:
asByteArray
in interfaceAttachment
-
asDataHandler
public jakarta.activation.DataHandler asDataHandler()Description copied from interface:Attachment
Gets the attachment as aDataHandler
.- Specified by:
asDataHandler
in interfaceAttachment
-
asSource
Description copied from interface:Attachment
Gets the attachment as aSource
. Note that there's no guarantee that the attachment is actually an XML.- Specified by:
asSource
in interfaceAttachment
-
asInputStream
Description copied from interface:Attachment
Obtains this attachment as anInputStream
.- Specified by:
asInputStream
in interfaceAttachment
-
writeTo
Description copied from interface:Attachment
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) throws jakarta.xml.soap.SOAPException Description copied from interface:Attachment
Writes this attachment to the givenSOAPMessage
.- Specified by:
writeTo
in interfaceAttachment
- Throws:
jakarta.xml.soap.SOAPException
-