title: Ant + run a target if file exists
body: <p>I need to run another task only if java files are present in a location. I have searched for the same and came across something like the below:</p>
  
  <pre><code>&lt;target name="check-abc"&gt;
  &lt;available file="abc.txt" property="abc.present"/&gt;
  </code></pre>
  
  <p><code>&lt;/target&gt;</code></p>
  
  <p><code>&lt;target name="do-if-abc" depends="check-abc" if="abc.present"&gt;</code>
      ...
  <code>&lt;/target&gt;</code></p>
  
  <p>However in my situation, the file path is not fixed. I am having a directory with many sub directories and files. If java files are present in any of those locations, the property should set and run the second target. Please advice.</p>