Oracle

com.compoze.collab
Interface IAttachmentSource

All Known Subinterfaces:
IAttachment, IEmbeddedAttachment
All Known Implementing Classes:
FileAttachmentSource, InputStreamAttachmentSource

public interface IAttachmentSource

Supplies data for adding an attachment.


Method Summary
 java.io.InputStream getInputStream()
          Gets the input stream for this attachment source.
 java.lang.String getName()
          Gets the name of the attachment source.
 int getSize()
          Gets the size of the attachment in bytes.
 

Method Detail

getInputStream

java.io.InputStream getInputStream()
                                   throws CollaborationException,
                                          java.io.IOException
Gets the input stream for this attachment source. If the size is not known (getSize() returns -1) then it must be safe to call this method multiple times so that we can read the stream first to get a size.

Returns:
the InputStream to the attachment data (not null)
Throws:
CollaborationException - if there was a problem getting the stream from the source
java.io.IOException - if an I/O error occurred

getName

java.lang.String getName()
                         throws CollaborationException
Gets the name of the attachment source.

Returns:
the name of the attachment (not null)
Throws:
CollaborationException - if there was a problem getting the name

getSize

int getSize()
            throws CollaborationException
Gets the size of the attachment in bytes.

Returns:
the size of the attachment (or -1 if the size is not known, in which case it must be safe to call getInputStream() multiple times so that we can read the stream first to get a size
Throws:
CollaborationException - if there was a problem getting the size

Oracle

Copyright ©1999-2008 Oracle All rights reserved.