You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by di...@apache.org on 2001/08/30 19:43:21 UTC

cvs commit: xml-cocoon2/src/org/apache/cocoon/reading ResourceReader.java

dims        01/08/30 10:43:21

  Modified:    src/org/apache/cocoon/reading ResourceReader.java
  Log:
  Patch for "ResourceReader does not check for the unavailability of an InputSource's timestamp" from Joerg Henne <j....@levigo.de>
  
  Revision  Changes    Path
  1.9       +9 -3      xml-cocoon2/src/org/apache/cocoon/reading/ResourceReader.java
  
  Index: ResourceReader.java
  ===================================================================
  RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/reading/ResourceReader.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- ResourceReader.java	2001/08/22 03:51:05	1.8
  +++ ResourceReader.java	2001/08/30 17:43:21	1.9
  @@ -31,7 +31,7 @@
   /**
    *
    * @author <a href="mailto:Giacomo.Pati@pwr.ch">Giacomo Pati</a>
  - * @version CVS $Revision: 1.8 $ $Date: 2001/08/22 03:51:05 $
  + * @version CVS $Revision: 1.9 $ $Date: 2001/08/30 17:43:21 $
    *
    * The <code>ResourceReader</code> component is used to serve binary data
    * in a sitemap pipeline. It makes use of HTTP Headers to determine if
  @@ -84,7 +84,10 @@
        * @return The generated key hashes the src
        */
       public long generateKey() {
  -        return HashUtil.hash(this.inputSource.getSystemId());
  +        if (this.inputSource.getLastModified() != 0) {
  +            return HashUtil.hash(this.inputSource.getSystemId());
  +        }
  +        return 0;
       }
   
       /**
  @@ -94,7 +97,10 @@
        *         component is currently not cacheable.
        */
       public CacheValidity generateValidity() {
  -        return new TimeStampCacheValidity(this.inputSource.getLastModified());
  +        if (this.inputSource.getLastModified() != 0) {
  +            return new TimeStampCacheValidity(this.inputSource.getLastModified());
  +        }
  +        return null;
       }
   
       /**
  
  
  

----------------------------------------------------------------------
In case of troubles, e-mail:     webmaster@xml.apache.org
To unsubscribe, e-mail:          cocoon-cvs-unsubscribe@xml.apache.org
For additional commands, e-mail: cocoon-cvs-help@xml.apache.org