You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by rg...@apache.org on 2009/06/01 19:13:13 UTC

svn commit: r780730 - /commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/impl/DefaultFileSystemManager.java

Author: rgoers
Date: Mon Jun  1 17:13:13 2009
New Revision: 780730

URL: http://svn.apache.org/viewvc?rev=780730&view=rev
Log:
Do not append base path if file name contains a scheme

Modified:
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/impl/DefaultFileSystemManager.java

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/impl/DefaultFileSystemManager.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/impl/DefaultFileSystemManager.java?rev=780730&r1=780729&r2=780730&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/impl/DefaultFileSystemManager.java (original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/impl/DefaultFileSystemManager.java Mon Jun  1 17:13:13 2009
@@ -762,9 +762,10 @@
 
         // Adjust separators
         UriParser.fixSeparators(buffer);
+        String scheme = UriParser.extractScheme(buffer.toString());
 
         // Determine whether to prepend the base path
-        if (name.length() == 0 || buffer.charAt(0) != FileName.SEPARATOR_CHAR)
+        if (name.length() == 0 || (scheme == null && buffer.charAt(0) != FileName.SEPARATOR_CHAR ))
         {
             // Supplied path is not absolute
             if (!VFS.isUriStyle())
@@ -789,8 +790,16 @@
                     "vfs.provider/invalid-descendent-name.error", name);
         }
 
-        String scheme = realBase.getScheme();
-        String fullPath = realBase.getRootURI() + resolvedPath;
+        String fullPath;
+        if (scheme != null)
+        {
+            fullPath = resolvedPath;   
+        }
+        else
+        {
+            scheme = realBase.getScheme();
+            fullPath = realBase.getRootURI() + resolvedPath;
+        }
         final FileProvider provider = (FileProvider) providers.get(scheme);
         if (provider != null)
         {