commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgo...@apache.org
Subject svn commit: r758784 - /commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/UriParser.java
Date Thu, 26 Mar 2009 18:15:19 GMT
Author: rgoers
Date: Thu Mar 26 18:15:08 2009
New Revision: 758784

URL: http://svn.apache.org/viewvc?rev=758784&view=rev
Log:
On Windows a drive letter looks like a URI scheme.

Modified:
    commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/UriParser.java

Modified: commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/UriParser.java
URL: http://svn.apache.org/viewvc/commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/UriParser.java?rev=758784&r1=758783&r2=758784&view=diff
==============================================================================
--- commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/UriParser.java
(original)
+++ commons/proper/vfs/trunk/core/src/main/java/org/apache/commons/vfs/provider/UriParser.java
Thu Mar 26 18:15:08 2009
@@ -20,6 +20,7 @@
 import org.apache.commons.vfs.FileSystemException;
 import org.apache.commons.vfs.FileType;
 import org.apache.commons.vfs.VFS;
+import org.apache.commons.vfs.util.Os;
 
 /**
  * Utilities for dealing with URIs. See RFC 2396 for details.
@@ -243,6 +244,11 @@
 			{
 				// Found the end of the scheme
 				final String scheme = uri.substring(0, pos);
+                if (scheme.length() <= 1 && Os.isFamily(Os.OS_FAMILY_WINDOWS))
+                {
+                    // This is not a scheme, but a Windows drive letter
+                    return null;
+                }
 				if (buffer != null)
 				{
 					buffer.delete(0, pos + 1);



Mime
View raw message