ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: ant/src/testcases/org/apache/tools/ant/util FileUtilsTest.java
Date Wed, 16 Jul 2003 10:43:15 GMT
bodewig     2003/07/16 03:43:15

  Modified:    src/main/org/apache/tools/ant/launch Locator.java
               src/main/org/apache/tools/ant/util FileUtils.java
               src/testcases/org/apache/tools/ant/util FileUtilsTest.java
  Log:
  Make toURI and fromURI work correctly on Netware.
  
  Submitted by: Jeff Tulley <JTULLEY at novell dot com>
  
  Revision  Changes    Path
  1.4       +1 -1      ant/src/main/org/apache/tools/ant/launch/Locator.java
  
  Index: Locator.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/launch/Locator.java,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- Locator.java	9 Jul 2003 13:11:15 -0000	1.3
  +++ Locator.java	16 Jul 2003 10:43:11 -0000	1.4
  @@ -134,7 +134,7 @@
   
           uri = uri.replace('/', File.separatorChar);
           if (File.pathSeparatorChar == ';' && uri.startsWith("\\") && uri.length()
> 2
  -            && Character.isLetter(uri.charAt(1)) && uri.charAt(2) == ':')
{
  +            && Character.isLetter(uri.charAt(1)) && uri.lastIndexOf(':')
> -1) {
               uri = uri.substring(1);
           }
   
  
  
  
  1.49      +2 -2      ant/src/main/org/apache/tools/ant/util/FileUtils.java
  
  Index: FileUtils.java
  ===================================================================
  RCS file: /home/cvs/ant/src/main/org/apache/tools/ant/util/FileUtils.java,v
  retrieving revision 1.48
  retrieving revision 1.49
  diff -u -r1.48 -r1.49
  --- FileUtils.java	9 Jul 2003 13:11:16 -0000	1.48
  +++ FileUtils.java	16 Jul 2003 10:43:15 -0000	1.49
  @@ -1219,7 +1219,7 @@
               path = normalize(path).getAbsolutePath();
               sb.append("//");
               // add an extra slash for filesystems with drive-specifiers
  -            if (!path.startsWith("/")) {
  +            if (!path.startsWith(File.separator)) {
                   sb.append("/");
               }
   
  
  
  
  1.21      +6 -0      ant/src/testcases/org/apache/tools/ant/util/FileUtilsTest.java
  
  Index: FileUtilsTest.java
  ===================================================================
  RCS file: /home/cvs/ant/src/testcases/org/apache/tools/ant/util/FileUtilsTest.java,v
  retrieving revision 1.20
  retrieving revision 1.21
  diff -u -r1.20 -r1.21
  --- FileUtilsTest.java	11 Jul 2003 14:53:05 -0000	1.20
  +++ FileUtilsTest.java	16 Jul 2003 10:43:15 -0000	1.21
  @@ -438,6 +438,9 @@
           if (Os.isFamily("dos")) {
               assertEquals("file:///C:/foo", fu.toURI("c:\\foo"));
           }
  +        if (Os.isFamily("netware")) {
  +            assertEquals("file:///SYS:/foo", fu.toURI("sys:\\foo"));
  +        }
           assertEquals("file:///" + dosRoot + "foo", fu.toURI("/foo"));
           assertEquals("file:./foo",  fu.toURI("./foo"));
           assertEquals("file:///" + dosRoot + "foo", fu.toURI("\\foo"));
  @@ -452,6 +455,9 @@
        * test fromUri
        */
       public void testFromURI() {
  +        if (Os.isFamily("netware")) {
  +            assertEqualsIgnoreDriveCase("SYS:\\foo", fu.fromURI("file:///sys:/foo"));
  +        }
           if (Os.isFamily("dos")) {
               assertEqualsIgnoreDriveCase("C:\\foo", fu.fromURI("file:///c:/foo"));
           }
  
  
  

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


Mime
View raw message