| org.apache.cocoon.components.source.AbstractStreamSource
All known Subclasses: org.apache.cocoon.components.source.AbstractStreamWriteableSource, org.apache.cocoon.components.source.URLSource,
AbstractStreamSource | abstract public class AbstractStreamSource extends AbstractLogEnabled implements ModifiableSource(Code) | | This abstract class provides convenience methods to implement
a stream based Source. Implement getInputStream(), getSystemId() and
optionally override refresh(), recycle(), getLastModified() and
getContentLength() to obtain a valid Source implementation.
This base implementation provides services to parse HTML sources
(HTML is not valid XML) using JTidy, if present. The source is
considered to contain HTML if isHTMLContent() returns
true.
author: Sylvain Wallez author: Carsten Ziegeler version: CVS $Id: AbstractStreamSource.java 433543 2006-08-22 06:22:54Z crossley $ |
Method Summary | |
public boolean | exists() Returns true if getInputStream() succeeds. | public long | getContentLength() | public InputSource | getInputSource() | public long | getLastModified() | protected boolean | isHTMLContent() Does this source contain HTML ? If true, JTidy will be used (if available) to
parse the input as XML.
The default here is to return false. | public void | recycle() To be overriden in concrete subclasses if needed. | public void | refresh() To be overriden in concrete subclasses if needed. | public void | toSAX(ContentHandler handler) Stream content to a content handler or to an XMLConsumer. |
manager | protected ComponentManager manager(Code) | | The ComponentManager needed for streaming
|
AbstractStreamSource | protected AbstractStreamSource(ComponentManager manager)(Code) | | Construct a new object
|
exists | public boolean exists()(Code) | | Returns true if getInputStream() succeeds.
Subclasses can provide a more efficient implementation.
|
getContentLength | public long getContentLength()(Code) | | Override this method to set the Content Length
|
getLastModified | public long getLastModified()(Code) | | Override this method to set the Last Modification date
|
isHTMLContent | protected boolean isHTMLContent()(Code) | | Does this source contain HTML ? If true, JTidy will be used (if available) to
parse the input as XML.
The default here is to return false. Concrete subclasses should override
this if needed.
|
recycle | public void recycle()(Code) | | To be overriden in concrete subclasses if needed.
|
refresh | public void refresh()(Code) | | To be overriden in concrete subclasses if needed.
|
|
|