ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bode...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs Available.java
Date Mon, 08 Jan 2001 12:52:07 GMT
bodewig     01/01/08 04:52:07

  Modified:    .        WHATSNEW
               src/main/org/apache/tools/ant/taskdefs Available.java
  Log:
  Changed <available> to resolve relative resource names the same way as
  <property> does.
  
  Revision  Changes    Path
  1.66      +4 -0      jakarta-ant/WHATSNEW
  
  Index: WHATSNEW
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/WHATSNEW,v
  retrieving revision 1.65
  retrieving revision 1.66
  diff -u -r1.65 -r1.66
  --- WHATSNEW	2001/01/08 12:42:45	1.65
  +++ WHATSNEW	2001/01/08 12:52:05	1.66
  @@ -90,6 +90,10 @@
   * nested <classpath> elements of <taskdef> now work for <taskdef>s not
     nested into <target> as well.
   
  +* <property> and <available> will search for the resource /foo instead
  +  of /org/apache/tools/ant/taskdefs/foo when given a relative resource
  +  name foo.
  +
   Changes from Ant 1.1 to Ant 1.2
   ===============================
   
  
  
  
  1.16      +7 -1      jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Available.java
  
  Index: Available.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Available.java,v
  retrieving revision 1.15
  retrieving revision 1.16
  diff -u -r1.15 -r1.16
  --- Available.java	2001/01/03 14:18:29	1.15
  +++ Available.java	2001/01/08 12:52:06	1.16
  @@ -144,7 +144,13 @@
           if (loader != null) {
               return (loader.getResourceAsStream(resource) != null);
           } else {
  -            return (this.getClass().getResourceAsStream(resource) != null);
  +            ClassLoader cL = this.getClass().getClassLoader();
  +            if (cL != null) {
  +                return (cL.getResourceAsStream(resource) != null);
  +            } else {
  +                return 
  +                    (ClassLoader.getSystemResourceAsStream(resource) != null);
  +            }
           }
       }
   
  
  
  

Mime
View raw message