Package com.sun.xml.ws.api.message
Interface Attachment
-
- All Known Subinterfaces:
AttachmentEx
- All Known Implementing Classes:
AttachmentImpl
,ByteArrayAttachment
,DataHandlerAttachment
,EncryptedAttachment
,JAXBAttachment
,SAAJMessage.SAAJAttachment
,StreamAttachment
public interface Attachment
Attachment.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description byte[]
asByteArray()
Gets the attachment as an exact-length byte array.jakarta.activation.DataHandler
asDataHandler()
Gets the attachment as aDataHandler
.InputStream
asInputStream()
Obtains this attachment as anInputStream
.Source
asSource()
Gets the attachment as aSource
.String
getContentId()
Content ID of the attachment.String
getContentType()
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.
-
-
-
Method Detail
-
getContentId
@NotNull String getContentId()
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:- Returns:
- The content ID like "[email protected]", without surrounding '<' and '>' used as the transfer syntax.
-
getContentType
String getContentType()
Gets the MIME content-type of this attachment.
-
asByteArray
byte[] asByteArray()
Gets the attachment as an exact-length byte array.
-
asDataHandler
jakarta.activation.DataHandler asDataHandler()
Gets the attachment as aDataHandler
.
-
asSource
Source asSource()
Gets the attachment as aSource
. Note that there's no guarantee that the attachment is actually an XML.
-
asInputStream
InputStream asInputStream()
Obtains this attachment as anInputStream
.
-
writeTo
void writeTo(OutputStream os) throws IOException
Writes the contents of the attachment into the given stream.- Throws:
IOException
-
writeTo
void writeTo(jakarta.xml.soap.SOAPMessage saaj) throws jakarta.xml.soap.SOAPException
Writes this attachment to the givenSOAPMessage
.- Throws:
jakarta.xml.soap.SOAPException
-
-