title: Get a list of all the files in a directory (recursive)
body: <p>I'm trying to get (not print, that's easy) the list of files in a directory and its sub directories.</p>
  
  <p>I've tried:</p>
  
  <pre><code>def folder = "C:\\DevEnv\\Projects\\Generic";
  def baseDir = new File(folder);
  files = baseDir.listFiles();
  </code></pre>
  
  <p>I only get the directories. I've also tried:</p>
  
  <pre><code>def files = [];
  
  def processFileClosure = {
          println "working on ${it.canonicalPath}: "
          files.add (it.canonicalPath);
      }
  
  baseDir.eachFileRecurse(FileType.FILES, processFileClosure);
  </code></pre>
  
  <p>But "files" is not recognized in the scope of the closure.</p>
  
  <p>How do I get the list?</p>