org.apache.cocoon.mail.datasource
Class AbstractDataSource

java.lang.Object
  extended byorg.apache.cocoon.util.AbstractLogEnabled
      extended byorg.apache.cocoon.mail.datasource.AbstractDataSource
All Implemented Interfaces:
DataSource
Direct Known Subclasses:
FilePartDataSource, InputStreamDataSource, SourceDataSource

public abstract class AbstractDataSource
extends org.apache.cocoon.util.AbstractLogEnabled
implements DataSource

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

Version:
$Id: AbstractDataSource.html 1304280 2012-03-23 11:18:01Z 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.cocoon.util.AbstractLogEnabled
getLogger, setLogger
 
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-2008 The Apache Software Foundation. All Rights Reserved.