unico 2004/03/23 04:46:39
Modified: src/blocks/scratchpad/java/org/apache/cocoon/components/source/impl TraversableCachingSource.java Log: set lastmodified to current time if not available from wrapped source Revision Changes Path 1.2 +9 -2 cocoon-2.1/src/blocks/scratchpad/java/org/apache/cocoon/components/source/impl/TraversableCachingSource.java Index: TraversableCachingSource.java =================================================================== RCS file: /home/cvs/cocoon-2.1/src/blocks/scratchpad/java/org/apache/cocoon/components/source/impl/TraversableCachingSource.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- TraversableCachingSource.java 22 Mar 2004 17:38:25 -0000 1.1 +++ TraversableCachingSource.java 23 Mar 2004 12:46:38 -0000 1.2 @@ -164,10 +164,17 @@ protected SourceMeta readMeta() throws IOException { final TraversableSourceMeta meta = new TraversableSourceMeta(); + final long lastModified = getTraversableSource().getLastModified(); + if (lastModified > 0) { + meta.setLastModified(lastModified); + } + else { + meta.setLastModified(System.currentTimeMillis()); + } + meta.setMimeType(getTraversableSource().getMimeType()); + meta.setName(getTraversableSource().getName()); meta.setIsCollection(getTraversableSource().isCollection()); - meta.setLastModified(getTraversableSource().getLastModified()); - meta.setMimeType(getTraversableSource().getMimeType()); if (meta.isCollection()) { final Collection children = getTraversableSource().getChildren();