[PATCH] RE: [io/configuration] file:// URL problem

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] RE: [io/configuration] file:// URL problem

Poppe, Troy

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:[hidden email]]
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: [hidden email]
For additional commands, e-mail: [hidden email]



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]