com.sun.xml.ws.message.saaj
Class SAAJMessage.SAAJAttachment

java.lang.Object
  extended by 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
SAAJMessage.SAAJAttachment(AttachmentPart part)
           
 
Method Summary
 byte[] asByteArray()
          Gets the attachment as an exact-length byte array.
 DataHandler asDataHandler()
          Gets the attachment as a DataHandler.
 InputStream asInputStream()
          Obtains this attachment as an InputStream.
 Source asSource()
          Gets the attachment as a Source.
 String getContentId()
          Content ID of the attachment.
 String getContentType()
          Gets the MIME content-type of this attachment.
 Iterator<AttachmentEx.MimeHeader> getMimeHeaders()
          Iterator of custom MIME headers associated with this attachment
 void writeTo(OutputStream os)
          Writes the contents of the attachment into the given stream.
 void writeTo(SOAPMessage saaj)
          Writes this attachment to the given SOAPMessage.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SAAJMessage.SAAJAttachment

public SAAJMessage.SAAJAttachment(AttachmentPart part)
Method Detail

getContentId

public String getContentId()
Content ID of the attachment. Uniquely identifies an attachment.

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()
Gets the MIME content-type of this attachment.

Specified by:
getContentType in interface Attachment

asByteArray

public byte[] asByteArray()
Gets the attachment as an exact-length byte array.

Specified by:
asByteArray in interface Attachment

asDataHandler

public DataHandler asDataHandler()
Gets the attachment as a DataHandler.

Specified by:
asDataHandler in interface Attachment

asSource

public Source asSource()
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

asInputStream

public InputStream asInputStream()
Obtains this attachment as an InputStream.

Specified by:
asInputStream in interface Attachment

writeTo

public void writeTo(OutputStream os)
             throws IOException
Writes the contents of the attachment into the given stream.

Specified by:
writeTo in interface Attachment
Throws:
IOException

writeTo

public void writeTo(SOAPMessage saaj)
Writes this attachment to the given SOAPMessage.

Specified by:
writeTo in interface Attachment

getMimeHeaders

public Iterator<AttachmentEx.MimeHeader> getMimeHeaders()
Description copied from interface: AttachmentEx
Iterator of custom MIME headers associated with this attachment

Specified by:
getMimeHeaders in interface AttachmentEx
Returns:
MIME header iterator


Copyright © 2005-2015 Oracle Corporation. All Rights Reserved.