You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by vg...@apache.org on 2001/08/05 18:55:37 UTC
cvs commit: xml-cocoon2/src/org/apache/cocoon/components/url URLFactoryImpl.java
vgritsenko 01/08/05 09:55:37
Modified: src/org/apache/cocoon/components/url URLFactoryImpl.java
Log:
Make 'file:' protocol url always have '/'
Revision Changes Path
1.6 +8 -2 xml-cocoon2/src/org/apache/cocoon/components/url/URLFactoryImpl.java
Index: URLFactoryImpl.java
===================================================================
RCS file: /home/cvs/xml-cocoon2/src/org/apache/cocoon/components/url/URLFactoryImpl.java,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- URLFactoryImpl.java 2001/07/13 11:25:00 1.5
+++ URLFactoryImpl.java 2001/08/05 16:55:37 1.6
@@ -29,7 +29,7 @@
/**
* @author <a href="mailto:giacomo@apache.org">Giacomo Pati</a>
- * @version $Id: URLFactoryImpl.java,v 1.5 2001/07/13 11:25:00 cziegeler Exp $
+ * @version $Id: URLFactoryImpl.java,v 1.6 2001/08/05 16:55:37 vgritsenko Exp $
*/
public class URLFactoryImpl extends AbstractLoggable implements URLFactory, Component, Configurable, Contextualizable {
@@ -95,7 +95,13 @@
if ( base != null ) {
if (base.getProtocol().equals("file")) {
File temp = new File(base.toExternalForm().substring("file:".length()), location);
- return getURL("file:" + temp.getAbsolutePath());
+ String path = temp.getAbsolutePath();
+ // VG: M$ paths starts with drive letter
+ if (path.charAt(0) != File.separator.charAt(0)) {
+ return getURL("file:/" + path);
+ } else {
+ return getURL("file:" + path);
+ }
}
return getURL(new URL(base, location).toExternalForm());
----------------------------------------------------------------------
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