java/ant/src/org/apidesign/infra/ant/GrepFilter.java
changeset 274 e1a7420cea38
parent 268 fb9bf90251e3
child 275 ee4c87a79dba
     1.1 --- a/java/ant/src/org/apidesign/infra/ant/GrepFilter.java	Sun Jul 06 00:12:56 2008 +0200
     1.2 +++ b/java/ant/src/org/apidesign/infra/ant/GrepFilter.java	Sun Aug 17 17:15:52 2008 +0200
     1.3 @@ -4,6 +4,8 @@
     1.4  import java.io.File;
     1.5  import java.io.FileReader;
     1.6  import java.io.IOException;
     1.7 +import java.net.MalformedURLException;
     1.8 +import java.net.URL;
     1.9  import java.util.HashMap;
    1.10  import java.util.Map;
    1.11  import java.util.Stack;
    1.12 @@ -26,6 +28,7 @@
    1.13      private Pattern begin = Pattern.compile(".* BEGIN: *(\\p{Graph}+)[-\\> ]*");
    1.14      private Pattern end = Pattern.compile(".* (END|FINISH): *(\\p{Graph}+)[-\\> ]*");
    1.15      private boolean openoffice;
    1.16 +    private Map<String,String> paths = new HashMap<String, String>();
    1.17      
    1.18      
    1.19      public FileSet createFileSet() {
    1.20 @@ -111,6 +114,7 @@
    1.21                          throw new BuildException("Not closed section " + entry.getKey() + " in " + file);
    1.22                      }
    1.23                      entry.setValue(v.toString());
    1.24 +                    paths.put(entry.getKey(), path);
    1.25                  }
    1.26              }
    1.27              
    1.28 @@ -136,6 +140,10 @@
    1.29          FilterSet filter = createFilterSet();
    1.30          getProject().addReference(id, filter);
    1.31      }
    1.32 +
    1.33 +    final URL getPath(URL root, String key) throws MalformedURLException {
    1.34 +        return new URL(root, paths.get(key));
    1.35 +    }
    1.36      
    1.37      private String linize(String input) {
    1.38          if (!openoffice) {