org.springframework.ws.soap
Interface Attachment


public interface Attachment

Represents an attachment to a SoapMessage.

Author:
Arjen Poutsma
See Also:
SoapMessage.getAttachments(), SoapMessage.addAttachment(java.io.File), SoapMessage.addAttachment(org.springframework.core.io.InputStreamSource, String)

Method Summary
 java.lang.String getContentType()
          Returns the content type of the attachment.
 java.lang.String getId()
          Returns the identifier of the attachment.
 java.io.InputStream getInputStream()
          Return an InputStream to read the contents of the attachment from.
 long getSize()
          Returns the size of the attachment in bytes.
 

Method Detail

getId

java.lang.String getId()
Returns the identifier of the attachment. Depending on the implementation used, this may be a MIME Content-Id header, a DIME ID, etc.

Returns:
the attachment identifier, or null if empty or not defined

getContentType

java.lang.String getContentType()
Returns the content type of the attachment.

Returns:
the content type, or null if empty or not defined

getInputStream

java.io.InputStream getInputStream()
                                   throws java.io.IOException
Return an InputStream to read the contents of the attachment from. The user is responsible for closing the stream.

Returns:
the contents of the file as stream, or an empty stream if empty
Throws:
java.io.IOException - in case of access I/O errors

getSize

long getSize()
Returns the size of the attachment in bytes.

Returns:
the size of the attachment, or 0 if empty


Copyright © 2002-2006. All Rights Reserved.