dims 02/02/24 15:33:12
Modified: src/java/org/apache/cocoon/components/pipeline
NonCachingStreamPipeline.java
src/java/org/apache/cocoon/components/source URLSource.java
Log:
- Fixed "resource://" url's always had lastModificationDate of zero.
- Allow users to extend NonCachingStreamPipeline by removing "final"
Revision Changes Path
1.5 +2 -2
xml-cocoon2/src/java/org/apache/cocoon/components/pipeline/NonCachingStreamPipeline.java
Index: NonCachingStreamPipeline.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/pipeline/NonCachingStreamPipeline.java,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- NonCachingStreamPipeline.java 22 Feb 2002 07:00:11 -0000 1.4
+++ NonCachingStreamPipeline.java 24 Feb 2002 23:33:12 -0000 1.5
@@ -63,9 +63,9 @@
* resource
* </UL>
* @author <a href="mailto:[EMAIL PROTECTED]">Giacomo Pati</a>
- * @version CVS $Id: NonCachingStreamPipeline.java,v 1.4 2002/02/22 07:00:11
cziegeler Exp $
+ * @version CVS $Id: NonCachingStreamPipeline.java,v 1.5 2002/02/24 23:33:12 dims
Exp $
*/
-public final class NonCachingStreamPipeline extends AbstractStreamPipeline {
+public class NonCachingStreamPipeline extends AbstractStreamPipeline {
/** Setup pipeline components.
*/
1.12 +11 -4
xml-cocoon2/src/java/org/apache/cocoon/components/source/URLSource.java
Index: URLSource.java
===================================================================
RCS file:
/home/cvs/xml-cocoon2/src/java/org/apache/cocoon/components/source/URLSource.java,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- URLSource.java 22 Feb 2002 23:25:18 -0000 1.11
+++ URLSource.java 24 Feb 2002 23:33:12 -0000 1.12
@@ -74,8 +74,10 @@
import java.net.HttpURLConnection;
import java.net.URLConnection;
import java.net.URL;
+import java.net.JarURLConnection;
import java.util.Iterator;
import java.util.Properties;
+import java.util.jar.JarEntry;
import javax.xml.transform.OutputKeys;
import javax.xml.transform.Transformer;
import javax.xml.transform.TransformerFactory;
@@ -86,7 +88,7 @@
* Description of a source which is described by an URL.
*
* @author <a href="mailto:[EMAIL PROTECTED]">Carsten Ziegeler</a>
- * @version CVS $Id: URLSource.java,v 1.11 2002/02/22 23:25:18 sylvain Exp $
+ * @version CVS $Id: URLSource.java,v 1.12 2002/02/24 23:33:12 dims Exp $
*/
public class URLSource extends AbstractStreamSource {
@@ -140,7 +142,7 @@
this.url = url;
this.gotInfos = false;
}
-
+
protected boolean isHTMLContent() {
return this.isHTMLContent;
}
@@ -165,14 +167,19 @@
this.connection.setRequestProperty("Authorization","Basic
"+SourceUtil.encodeBASE64(userInfo));
}
}
- this.lastModificationDate =
this.connection.getLastModified();
+ if(this.connection instanceof JarURLConnection) {
+ JarEntry entry =
((JarURLConnection)this.connection).getJarEntry();
+ this.lastModificationDate = entry.getTime();
+ } else {
+ this.lastModificationDate =
this.connection.getLastModified();
+ }
this.contentLength = this.connection.getContentLength();
} catch (IOException ignore) {
this.lastModificationDate = 0;
this.contentLength = -1;
}
} else {
- // do not open connection when using post!
+ // do not open connection when using post!
this.lastModificationDate = 0;
this.contentLength = -1;
}
----------------------------------------------------------------------
In case of troubles, e-mail: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]