public final class JAXBAttachment extends Object implements Attachment, javax.activation.DataSource
Constructor and Description |
---|
JAXBAttachment(String contentId,
Object jaxbObject,
XMLBridge bridge,
String mimeType) |
Modifier and Type | Method and Description |
---|---|
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.
|
InputStream |
getInputStream() |
String |
getName() |
OutputStream |
getOutputStream() |
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 . |
public String getContentId()
Attachment
getContentId
in interface Attachment
public String getContentType()
Attachment
getContentType
in interface Attachment
getContentType
in interface javax.activation.DataSource
public byte[] asByteArray()
Attachment
asByteArray
in interface Attachment
public javax.activation.DataHandler asDataHandler()
Attachment
DataHandler
.asDataHandler
in interface Attachment
public Source asSource()
Attachment
Source
.
Note that there's no guarantee that the attachment is actually an XML.asSource
in interface Attachment
public InputStream asInputStream()
Attachment
InputStream
.asInputStream
in interface Attachment
public void writeTo(OutputStream os) throws IOException
Attachment
writeTo
in interface Attachment
IOException
public void writeTo(javax.xml.soap.SOAPMessage saaj) throws javax.xml.soap.SOAPException
Attachment
SOAPMessage
.writeTo
in interface Attachment
javax.xml.soap.SOAPException
public InputStream getInputStream() throws IOException
getInputStream
in interface javax.activation.DataSource
IOException
public OutputStream getOutputStream() throws IOException
getOutputStream
in interface javax.activation.DataSource
IOException
public String getName()
getName
in interface javax.activation.DataSource
Copyright (c) 1997-2012 Oracle and/or its affiliates. All rights reserved.