com.compoze.collab
Class FileAttachmentSource

java.lang.Object
  extended by com.compoze.collab.FileAttachmentSource
All Implemented Interfaces
IAttachmentSource

public class FileAttachmentSource
extends Object
implements IAttachmentSource

An IAttachmentSource that gets its data from a file.


Constructor Summary
FileAttachmentSource(File file)
          Constructor.
FileAttachmentSource(String sFile)
          Constructor.
 
Method Summary
 InputStream getInputStream()
          Gets the input stream for this attachment source.
 String getName()
          Gets the name of the attachment source.
 int getSize()
          Gets the size of the attachment in bytes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileAttachmentSource

public FileAttachmentSource(String sFile)
Constructor.

Parameters
sFile - the string representing the path and file name (not null)

FileAttachmentSource

public FileAttachmentSource(File file)
Constructor.

Parameters
file - the file (not null)
Method Detail

getInputStream

public InputStream getInputStream()
                           throws IOException
Description copied from interface: IAttachmentSource
Gets the input stream for this attachment source. If the size is not known (IAttachmentSource.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.

Specified by:
getInputStream in interface IAttachmentSource
Returns
the InputStream to the attachment data (not null)
Throws
IOException - if an I/O error occurred

getName

public String getName()
Description copied from interface: IAttachmentSource
Gets the name of the attachment source.

Specified by:
getName in interface IAttachmentSource
Returns
the name of the attachment (not null)

getSize

public int getSize()
Description copied from interface: IAttachmentSource
Gets the size of the attachment in bytes.

Specified by:
getSize in interface IAttachmentSource
Returns
the size of the attachment (or -1 if the size is not known, in which case it must be safe to call IAttachmentSource.getInputStream() multiple times so that we can read the stream first to get a size


Copyright © 2006 BEA Systems, Inc. All Rights Reserved