com.sun.xml.ws.encoding
Class MimeMultipartParser.PartAttachment

java.lang.Object
  extended by com.sun.xml.ws.encoding.MimeMultipartParser.PartAttachment
All Implemented Interfaces:
Attachment
Enclosing class:
MimeMultipartParser

static class MimeMultipartParser.PartAttachment
extends Object
implements Attachment


Field Summary
(package private)  byte[] buf
           
(package private)  org.jvnet.mimepull.MIMEPart part
           
 
Constructor Summary
MimeMultipartParser.PartAttachment(org.jvnet.mimepull.MIMEPart part)
           
 
Method Summary
 byte[] asByteArray()
          Gets the attachment as an exact-length byte array.
 javax.activation.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.
 void writeTo(OutputStream os)
          Writes the contents of the attachment into the given stream.
 void writeTo(javax.xml.soap.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
 

Field Detail

part

final org.jvnet.mimepull.MIMEPart part

buf

byte[] buf
Constructor Detail

MimeMultipartParser.PartAttachment

MimeMultipartParser.PartAttachment(org.jvnet.mimepull.MIMEPart part)
Method Detail

getContentId

@NotNull
public String getContentId()
Description copied from interface: Attachment
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

@NotNull
public String getContentType()
Description copied from interface: Attachment
Gets the MIME content-type of this attachment.

Specified by:
getContentType in interface Attachment

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 javax.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

asInputStream

public InputStream asInputStream()
Description copied from interface: Attachment
Obtains this attachment as an InputStream.

Specified by:
asInputStream in interface Attachment

writeTo

public void writeTo(OutputStream os)
             throws IOException
Description copied from interface: Attachment
Writes the contents of the attachment into the given stream.

Specified by:
writeTo in interface Attachment
Throws:
IOException

writeTo

public void writeTo(javax.xml.soap.SOAPMessage saaj)
             throws javax.xml.soap.SOAPException
Description copied from interface: Attachment
Writes this attachment to the given SOAPMessage.

Specified by:
writeTo in interface Attachment
Throws:
javax.xml.soap.SOAPException