commons-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Poppe, Troy" <Troy.Po...@eia.doe.gov>
Subject [PATCH] RE: [io/configuration] file:// URL problem
Date Fri, 10 Jun 2005 14:25:16 GMT

Here's a quick patch... (As if one was needed....)

Index: src/java/org/apache/commons/vfs/provider/local/LocalFileName.java
===================================================================
--- src/java/org/apache/commons/vfs/provider/local/LocalFileName.java	(revision
189963)
+++ src/java/org/apache/commons/vfs/provider/local/LocalFileName.java	(working
copy)
@@ -62,7 +62,7 @@
     protected void appendRootUri(final StringBuffer buffer)
     {
         buffer.append(getScheme());
-        buffer.append("://");
+        buffer.append(":///");
         buffer.append(rootFile);
     }
 }





-----Original Message-----
From: Jörg Schaible [mailto:Joerg.Schaible@Elsag-Solutions.com] 
Sent: Friday, June 10, 2005 2:34 AM
To: Jakarta Commons Users List
Subject: RE: [io/configuration] file:// URL problem


Poppe, Troy wrote on Thursday, June 09, 2005 10:27 PM:

> It appears that my problem stems not from io or configuration, but 
> instead from VFS!
> 
> I grabbed the latest VFS from SVN, and dug through it a bit, and I 
> think there might be a bug in 
> org.apache.commons.vfs.provider.local.LocalFileName.
> 
> Currently the code reads:
>     /**
>      * Builds the root URI for this file name.
>      */
>     protected void appendRootUri(final StringBuffer buffer)     {
>         buffer.append(getScheme());
>         buffer.append("://");
>         buffer.append(rootFile);
>     }
> 
> However, for file URLs, it appears that the JVM wants to see them as 
> "file:/" or "file:///"...
> 
> Is this a fix that would be acceptable?  (I'm not able to verify if 
> this is a JVM 'bug' or a conflict with RFC2396.) Is there another work 
> around?

It should add a third slash. file:/// is an official shortcut for
file://localhost/ and the file name should have been appended then. This get's
funny if you address files on a windows share file://///Machine/share/ <g>

- Jörg

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-user-help@jakarta.apache.org


Mime
View raw message