ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mben...@apache.org
Subject svn commit: r359270 - /ant/core/trunk/src/testcases/org/apache/tools/ant/util/FileUtilsTest.java
Date Tue, 27 Dec 2005 20:06:56 GMT
Author: mbenson
Date: Tue Dec 27 12:06:54 2005
New Revision: 359270

URL: http://svn.apache.org/viewcvs?rev=359270&view=rev
Log:
preserve case on Cygwin when using 1.4 toURI

Modified:
    ant/core/trunk/src/testcases/org/apache/tools/ant/util/FileUtilsTest.java

Modified: ant/core/trunk/src/testcases/org/apache/tools/ant/util/FileUtilsTest.java
URL: http://svn.apache.org/viewcvs/ant/core/trunk/src/testcases/org/apache/tools/ant/util/FileUtilsTest.java?rev=359270&r1=359269&r2=359270&view=diff
==============================================================================
--- ant/core/trunk/src/testcases/org/apache/tools/ant/util/FileUtilsTest.java (original)
+++ ant/core/trunk/src/testcases/org/apache/tools/ant/util/FileUtilsTest.java Tue Dec 27 12:06:54
2005
@@ -444,8 +444,17 @@
     public void testToURI() {
         String dosRoot = null;
         if (Os.isFamily("dos") || Os.isFamily("netware")) {
-            dosRoot = Character.toUpperCase(
-                System.getProperty("user.dir").charAt(0)) + ":/";
+            dosRoot = System.getProperty("user.dir")
+                .substring(0, 3).replace(File.separatorChar, '/');
+
+            //preserve case on Cygwin when using 1.4 toURI:
+            Class uriClazz = null;
+            try {
+                uriClazz = Class.forName("java.net.URI");
+            } catch (ClassNotFoundException e) {
+                // OK, Java 1.3.
+                dosRoot = dosRoot.toUpperCase();
+            }
         }
         else
         {



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message