org.apache.cocoon.mail.datasource
Class AbstractDataSource

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

public abstract class AbstractDataSource
extends AbstractLogEnabled
implements DataSource

The AbstractDataSource class is a base class for other DataSource implementation.

Version:
$Id: AbstractDataSource.html 1304258 2012-03-23 10:09:27Z ilgrosso $

Constructor Summary
AbstractDataSource()
           
AbstractDataSource(String name, String type)
           
 
Method Summary
 String getContentType()
           
abstract  InputStream getInputStream()
          Get the InputStream for this DataSource.
 String getName()
          Returns the name for this DataSource object.
 OutputStream getOutputStream()
          Not implemented.
protected static boolean isNullOrEmpty(String str)
          Check String for null or empty.
 void setContentType(String contentType)
           
 void setName(String name)
           
 
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

AbstractDataSource

public AbstractDataSource()

AbstractDataSource

public AbstractDataSource(String name,
                          String type)
Parameters:
name - Name of the content part
type - Mime type of the content
Method Detail

isNullOrEmpty

protected static boolean isNullOrEmpty(String str)
Check String for null or empty.

Parameters:
str -
Returns:
true if str is null, empty string, or equals "null"

getName

public String getName()
Returns the name for this DataSource object.

Specified by:
getName in interface DataSource

setName

public void setName(String name)

getContentType

public String getContentType()
Specified by:
getContentType in interface DataSource
Returns:
The content type (mime type) of this DataSource object.

setContentType

public void setContentType(String contentType)

getInputStream

public abstract InputStream getInputStream()
                                    throws IOException
Get the InputStream for this DataSource.

Specified by:
getInputStream in interface DataSource
Throws:
IOException

getOutputStream

public OutputStream getOutputStream()
                             throws IOException
Not implemented. Throws IOException.

Specified by:
getOutputStream in interface DataSource
Throws:
IOException - since unimplemented


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