title: Getting file name inside Ant copy task filter
body: <p>Is it possible to get the current file name being copied inside an Ant copy task? I am trying to run a beanshell script and would like access to the current file name:</p>
  
  <pre><code>&lt;target&gt;
      &lt;mkdir dir="${project.build.directory}/generated-sources"/&gt;
      &lt;copy todir="${project.build.directory}/generated-sources"
            includeemptydirs="true" failonerror="true" verbose="true"&gt;
          &lt;fileset dir="${project.build.sourceDirectory}"/&gt;
          &lt;filterchain&gt;
              &lt;tokenfilter&gt;
                  &lt;filetokenizer/&gt;
                  &lt;scriptfilter language="beanshell" byline="true"&gt;&lt;![CDATA[
                      import java.io.BufferedReader;
                      import java.io.StringReader;
                      int count = 1;
                      BufferedReader br = new BufferedReader(new StringReader(self.getToken()));
                      StringBuilder builder = new StringBuilder();
                      String line;
                      while ((line = br.readLine()) != null) {
                          builder.append(line.replace("\"__LINE__\"", Integer.toString(count))).append('\n');
                          count++;
                      }
                      self.setToken(builder.toString());
                  ]]&gt;&lt;/scriptfilter&gt;
              &lt;/tokenfilter&gt;
          &lt;/filterchain&gt;
      &lt;/copy&gt;
  &lt;/target&gt;
  </code></pre>