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

java.lang.Object
  extended by org.apache.excalibur.source.impl.AbstractSource
      extended by fr.gouv.culture.util.apache.cocoon.components.source.URLSource
All Implemented Interfaces:
org.apache.excalibur.source.Source

public class URLSource
extends org.apache.excalibur.source.impl.AbstractSource

Description of a source which is described by an URL. This class is not used by SDX anymore!

Version:
CVS $Id: URLSource.html,v 1.5 2010/05/24 07:56:42 malo_pichot Exp $
Author:
Carsten Ziegeler, Rasik Pandey

Field Summary
protected  org.apache.excalibur.source.SourceParameters requestProperties
          The SourceParameters used in the url connection request properties
 
Constructor Summary
URLSource(java.net.URL url)
          Construct a new object
 
Method Summary
protected  void addRequestProperties()
           
 boolean exists()
           
 long getContentLength()
          Get the content length of the source or -1 if it is not possible to determine the length.
protected  void getInfos()
          Get the last modification date and content length of the source.
 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
 java.lang.String toSAX(java.lang.Object toSaxObject)
           
 
Methods inherited from class org.apache.excalibur.source.impl.AbstractSource
checkInfos, getMimeType, getScheme, getURI, getValidity, setContentLength, setLastModified, setScheme, setSystemId
 
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)
          throws java.io.IOException
Construct a new object

Throws:
java.io.IOException
Method Detail

exists

public boolean exists()

isHTMLContent

protected boolean isHTMLContent()

getInfos

protected void getInfos()
Get the last modification date and content length of the source. Any exceptions are ignored.

Overrides:
getInfos in class org.apache.excalibur.source.impl.AbstractSource

getLastModified

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

Specified by:
getLastModified in interface org.apache.excalibur.source.Source
Overrides:
getLastModified in class org.apache.excalibur.source.impl.AbstractSource

getContentLength

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

Specified by:
getContentLength in interface org.apache.excalibur.source.Source
Overrides:
getContentLength in class org.apache.excalibur.source.impl.AbstractSource

getInputStream

public java.io.InputStream getInputStream()
                                   throws java.io.IOException,
                                          org.apache.excalibur.source.SourceException
Return an InputStream object to read from the source.

Specified by:
getInputStream in interface org.apache.excalibur.source.Source
Overrides:
getInputStream in class org.apache.excalibur.source.impl.AbstractSource
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.excalibur.source.SourceException

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.

Specified by:
refresh in interface org.apache.excalibur.source.Source
Overrides:
refresh in class org.apache.excalibur.source.impl.AbstractSource

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()

toSAX

public java.lang.String toSAX(java.lang.Object toSaxObject)


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