vgritsenko 01/08/05 09:56:36
Modified: src/org/apache/cocoon/components/url Tag: cocoon_20_branch
URLFactoryImpl.java
Log:
Make 'file:' protocol url always have '/'
Revision Changes Path
No revision
No revision
1.2.2.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.2.2.5
retrieving revision 1.2.2.6
diff -u -r1.2.2.5 -r1.2.2.6
--- URLFactoryImpl.java 2001/07/13 11:26:58 1.2.2.5
+++ URLFactoryImpl.java 2001/08/05 16:56:36 1.2.2.6
@@ -29,7 +29,7 @@
/**
* @author <a href="mailto:[EMAIL PROTECTED]">Giacomo Pati</a>
- * @version $Id: URLFactoryImpl.java,v 1.2.2.5 2001/07/13 11:26:58 cziegeler Exp $
+ * @version $Id: URLFactoryImpl.java,v 1.2.2.6 2001/08/05 16:56:36 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: [EMAIL PROTECTED]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]