cmlenz      2003/06/09 03:13:10

  Modified:    integration/ant/src/java/org/apache/cactus/integration/ant/util
                        ResourceUtils.java
  Log:
  Decode URLs of classpath resource locations. This fixes a bug with classpath entries 
that contain spaces in the path (which worked on JDK1.3.1, but not on JDK1.4.2)
  
  Revision  Changes    Path
  1.10      +4 -3      
jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/util/ResourceUtils.java
  
  Index: ResourceUtils.java
  ===================================================================
  RCS file: 
/home/cvs/jakarta-cactus/integration/ant/src/java/org/apache/cactus/integration/ant/util/ResourceUtils.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- ResourceUtils.java        14 May 2003 13:14:59 -0000      1.9
  +++ ResourceUtils.java        9 Jun 2003 10:13:09 -0000       1.10
  @@ -66,6 +66,7 @@
   import java.io.InputStreamReader;
   import java.io.OutputStream;
   import java.net.URL;
  +import java.net.URLDecoder;
   import java.util.Vector;
   
   import org.apache.tools.ant.Project;
  @@ -230,13 +231,13 @@
               {
                   int pling = urlString.indexOf("!");
                   String jar = urlString.substring(9, pling);
  -                file = new File(jar);
  +                file = new File(URLDecoder.decode(jar));
               }
               else if (urlString.startsWith("file:"))
               {
                   int tail = urlString.indexOf(theResourceName);
                   String dir = urlString.substring(5, tail);
  -                file = new File(dir);
  +                file = new File(URLDecoder.decode(dir));
               }
           }
           return file;
  
  
  

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to