Spring Web Services Framework

org.springframework.ws.mime
Interface Attachment


public interface Attachment

Represents an attachment to a MimeMessage

Since:
1.0.0
Author:
Arjen Poutsma
See Also:
MimeMessage.getAttachments(), MimeMessage.addAttachment(java.lang.String, java.io.File)

Method Summary
 String getContentId()
          Returns the content identifier of the attachment.
 String getContentType()
          Returns the content type of the attachment.
 DataHandler getDataHandler()
          Returns the data handler of the attachment.
 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

getContentId

String getContentId()
Returns the content identifier of the attachment.

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

getContentType

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

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

getInputStream

InputStream getInputStream()
                           throws 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:
IOException - in case of access I/O errors

getSize

long getSize()
Returns the size of the attachment in bytes. Returns -1 if the size cannot be determined.

Returns:
the size of the attachment, 0 if empty, or -1 if the size cannot be determined

getDataHandler

DataHandler getDataHandler()
Returns the data handler of the attachment.

Returns:
the data handler of the attachment

Spring Web Services Framework

Copyright © 2005-2013 The Spring Web Services Framework. All Rights Reserved.