fr.gouv.culture.util.apache.cocoon.components.source
Class URLSource

java.lang.Object
  extended byorg.apache.avalon.framework.logger.AbstractLoggable
      extended byorg.apache.cocoon.components.source.AbstractStreamSource
          extended byfr.gouv.culture.util.apache.cocoon.components.source.URLSource
All Implemented Interfaces:
org.apache.avalon.framework.logger.Loggable, org.apache.cocoon.environment.ModifiableSource, org.apache.avalon.excalibur.pool.Poolable, org.apache.avalon.excalibur.pool.Recyclable, org.apache.cocoon.environment.Source, org.apache.cocoon.xml.XMLizable

public class URLSource
extends org.apache.cocoon.components.source.AbstractStreamSource

Description of a source which is described by an URL.

Version:
CVS $Id: URLSource.java,v 1.2 2003/06/13 12:18:29 rpandey Exp $
Author:
Carsten Ziegeler, Rasik Pandey

Field Summary
protected  org.apache.excalibur.source.SourceParameters requestProperties
          The SourceParameters used in the url connection request properties
 
Fields inherited from class org.apache.cocoon.components.source.AbstractStreamSource
manager, transformerFactory
 
Constructor Summary
URLSource(java.net.URL url, org.apache.avalon.framework.component.ComponentManager manager)
          Construct a new object
 
Method Summary
protected  void addRequestProperties()
           
 long getContentLength()
          Get the content length of the source or -1 if it is not possible to determine the length.
 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
protected  boolean isHTMLContent()
           
 void recycle()
           
 void refresh()
          Refresh this object and update the last modified date and content length.
 void setPostParameters(org.apache.excalibur.source.SourceParameters pars)
          Set the post parameters
 void setRequestProperties(org.apache.excalibur.source.SourceParameters pars)
          Set the request parameters
 
Methods inherited from class org.apache.cocoon.components.source.AbstractStreamSource
exists, getInputSource, toSAX
 
Methods inherited from class org.apache.avalon.framework.logger.AbstractLoggable
getLogger, setLogger, setupLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

requestProperties

protected org.apache.excalibur.source.SourceParameters requestProperties
The SourceParameters used in the url connection request properties

Constructor Detail

URLSource

public URLSource(java.net.URL url,
                 org.apache.avalon.framework.component.ComponentManager manager)
          throws java.io.IOException
Construct a new object

Method Detail

isHTMLContent

protected boolean isHTMLContent()

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 java.io.IOException,
                                          org.apache.cocoon.ProcessingException
Return an InputStream object to read from the source.

Throws:
org.apache.cocoon.ResourceNotFoundException - if file not found or HTTP location does not exist.
java.io.IOException - if I/O error occured.
org.apache.cocoon.ProcessingException

getSystemId

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


refresh

public void refresh()
Refresh this object and update the last modified date and content length.


recycle

public void recycle()

setPostParameters

public void setPostParameters(org.apache.excalibur.source.SourceParameters pars)
Set the post parameters


setRequestProperties

public void setRequestProperties(org.apache.excalibur.source.SourceParameters pars)
Set the request parameters


addRequestProperties

protected void addRequestProperties()


Copyright © 2000-2004 Ministere de la culture et de la communication / AJLSM. All Rights Reserved.