org.apache.cocoon.environment
Interface Source

All Superinterfaces:
org.apache.avalon.excalibur.pool.Poolable, org.apache.avalon.excalibur.pool.Recyclable, XMLizable
All Known Subinterfaces:
ModifiableSource, WriteableSource
All Known Implementing Classes:
AbstractSAXSource, DelayedRefreshSourceWrapper, XScriptObject

public interface Source
extends org.apache.avalon.excalibur.pool.Recyclable, XMLizable

Description of a source. This interface provides a simple interface for accessing a source of data. The source of data is assumed to not change during the lifetime of the Source object. If you have a data source that can change its content and you want it to reflect in Cocoon, use a ModifiableSource object instead.

Version:
CVS $Id: Source.java,v 1.4 2002/02/22 07:03:49 cziegeler Exp $
Author:
Carsten Ziegeler, Ovidiu Predescu

Method Summary
 long getContentLength()
          Get the content length of the source or -1 if it is not possible to determine the length.
 org.xml.sax.InputSource getInputSource()
          Return an InputSource object to read the XML content.
 java.io.InputStream getInputStream()
          Return an InputStream object to read from the source.
 long getLastModified()
          Get the last modification date of the source or 0 if it is not possible to determine the date.
 java.lang.String getSystemId()
          Return the unique identifer for this source
 
Methods inherited from interface org.apache.avalon.excalibur.pool.Recyclable
recycle
 
Methods inherited from interface org.apache.cocoon.xml.XMLizable
toSAX
 

Method Detail

getLastModified

public long getLastModified()
Get the last modification date of the source or 0 if it is not possible to determine the date.

getContentLength

public long getContentLength()
Get the content length of the source or -1 if it is not possible to determine the length.

getInputStream

public java.io.InputStream getInputStream()
                                   throws ProcessingException,
                                          java.io.IOException
Return an InputStream object to read from the source.

getInputSource

public org.xml.sax.InputSource getInputSource()
                                       throws ProcessingException,
                                              java.io.IOException
Return an InputSource object to read the XML content.
Returns:
an InputSource value
Throws:
ProcessingException - if an error occurs
java.io.IOException - if an error occurs

getSystemId

public java.lang.String getSystemId()
Return the unique identifer for this source


Copyright � 1999-2002 Apache Software Foundation. All Rights Reserved.