ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From co...@apache.org
Subject cvs commit: jakarta-ant/src/main/org/apache/tools/ant/taskdefs Filter.java
Date Sat, 04 Aug 2001 14:55:03 GMT
conor       01/08/04 07:55:03

  Modified:    src/main/org/apache/tools/ant/taskdefs Filter.java
  Log:
  Updated Filter task to use the new FilterSet in the Project fro global
  filters
  
  PR:	1545
  Submitted by:	Michael McCallum <gholam@xtra.co.nz>
  
  Revision  Changes    Path
  1.9       +3 -24     jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Filter.java
  
  Index: Filter.java
  ===================================================================
  RCS file: /home/cvs/jakarta-ant/src/main/org/apache/tools/ant/taskdefs/Filter.java,v
  retrieving revision 1.8
  retrieving revision 1.9
  diff -u -r1.8 -r1.9
  --- Filter.java	2001/01/03 14:18:30	1.8
  +++ Filter.java	2001/08/04 14:55:03	1.9
  @@ -68,6 +68,7 @@
    *
    * @author Stefano Mazzocchi <a href="mailto:stefano@apache.org">stefano@apache.org</a>
    * @author Gero Vermaas <a href="mailto:gero@xs4all.nl">gero@xs4all.nl</a>
  + * @author <A href="gholam@xtra.co.nz">Michael McCallum</A>
    */
   public class Filter extends Task {
   
  @@ -96,7 +97,7 @@
           }
           
           if (isSingleFilter) {
  -            project.addFilter(token, value);
  +            project.getGlobalFilterSet().addFilter(token, value);
           }
           
           if (isFiltersFromFile) {
  @@ -106,28 +107,6 @@
       
       protected void readFilters() throws BuildException {
           log("Reading filters from " + filtersFile, Project.MSG_VERBOSE);
  -        FileInputStream in = null;
  -        try {
  -            Properties props = new Properties();
  -            in = new FileInputStream(filtersFile);
  -            props.load(in);
  -
  -            Project proj = getProject();
  -
  -            Enumeration enum = props.propertyNames();
  -            while (enum.hasMoreElements()) {
  -                String strPropName = (String)enum.nextElement();
  -                String strValue = props.getProperty(strPropName);
  -                proj.addFilter(strPropName, strValue);
  -            }
  -        } catch (Exception e) {
  -            throw new BuildException("Could not read filters from file: " + filtersFile);
  -        } finally {
  -            if (in != null) {
  -                try {
  -                    in.close();
  -                } catch (java.io.IOException ioex) {}
  -            }
  -        }
  +        project.getGlobalFilterSet().readFiltersFromFile(filtersFile);
       }
   }
  
  
  

Mime
View raw message