Class JAXBAttachment

  • All Implemented Interfaces:
    Attachment, jakarta.activation.DataSource

    public final class JAXBAttachment
    extends Object
    implements Attachment, jakarta.activation.DataSource
    Author:
    Jitendra Kotamraju
    • Method Detail

      • getContentId

        public String 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%25foo1@bar.net" corresponds to Content-ID:
        Specified by:
        getContentId in interface Attachment
        Returns:
        The content ID like "foo-bar-zot@abc.com", without surrounding '<' and '>' used as the transfer syntax.
      • getContentType

        public String getContentType()
        Description copied from interface: Attachment
        Gets the MIME content-type of this attachment.
        Specified by:
        getContentType in interface Attachment
        Specified by:
        getContentType in interface jakarta.activation.DataSource
      • asByteArray

        public byte[] asByteArray()
        Description copied from interface: Attachment
        Gets the attachment as an exact-length byte array.
        Specified by:
        asByteArray in interface Attachment
      • asDataHandler

        public jakarta.activation.DataHandler asDataHandler()
        Description copied from interface: Attachment
        Gets the attachment as a DataHandler.
        Specified by:
        asDataHandler in interface Attachment
      • asSource

        public Source asSource()
        Description copied from interface: Attachment
        Gets the attachment as a Source. Note that there's no guarantee that the attachment is actually an XML.
        Specified by:
        asSource in interface Attachment
      • writeTo

        public void writeTo​(jakarta.xml.soap.SOAPMessage saaj)
                     throws jakarta.xml.soap.SOAPException
        Description copied from interface: Attachment
        Writes this attachment to the given SOAPMessage.
        Specified by:
        writeTo in interface Attachment
        Throws:
        jakarta.xml.soap.SOAPException
      • getInputStream

        public InputStream getInputStream()
                                   throws IOException
        Specified by:
        getInputStream in interface jakarta.activation.DataSource
        Throws:
        IOException
      • getOutputStream

        public OutputStream getOutputStream()
                                     throws IOException
        Specified by:
        getOutputStream in interface jakarta.activation.DataSource
        Throws:
        IOException
      • getName

        public String getName()
        Specified by:
        getName in interface jakarta.activation.DataSource