org.apache.cocoon.mail.datasource
Class FilePartDataSource

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.mail.datasource.AbstractDataSource
          extended by org.apache.cocoon.mail.datasource.FilePartDataSource
All Implemented Interfaces:
DataSource, LogEnabled

public class FilePartDataSource
extends AbstractDataSource

The FilePartDataSource class provides an object, that wraps a Cocoon Part object in a DataSource interface.

Version:
$Id: FilePartDataSource.html 1304258 2012-03-23 10:09:27Z ilgrosso $
See Also:
DataSource

Constructor Summary
FilePartDataSource(Part part)
          Creates a new instance of FilePartDataSource from an Part object.
FilePartDataSource(Part part, String type, String name)
          Creates a new instance of FilePartDataSource from an Part object.
 
Method Summary
 InputStream getInputStream()
          The InputStream object obtained from Part.getInputStream() object.
 
Methods inherited from class org.apache.cocoon.mail.datasource.AbstractDataSource
getContentType, getName, getOutputStream, isNullOrEmpty, setContentType, setName
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FilePartDataSource

public FilePartDataSource(Part part)
Creates a new instance of FilePartDataSource from an Part object.

Parameters:
part - An Part object.

FilePartDataSource

public FilePartDataSource(Part part,
                          String type,
                          String name)
Creates a new instance of FilePartDataSource from an Part object.

Parameters:
part - An Part object.
Method Detail

getInputStream

public InputStream getInputStream()
                           throws IOException
The InputStream object obtained from Part.getInputStream() object.

Specified by:
getInputStream in interface DataSource
Specified by:
getInputStream in class AbstractDataSource
Returns:
The InputStream object for this DataSource object.
Throws:
IOException - if an I/O error occurs.


Copyright © 1999-2010 The Apache Software Foundation. All Rights Reserved.