title: FileUtils.listFiles and IOFileFilter
body: <p>Hi i want to recursively check if the files and subfolders of a certain directory contain a certain string so tried this</p>
  
  <pre><code>package com.tecsys.sm.test;
  
  import java.io.File;
  import java.util.ArrayList;
  import java.util.Collection;
  import java.util.Iterator;
  
  import org.apache.commons.io.FileUtils;
  import org.apache.commons.io.filefilter.IOFileFilter;
  import org.apache.commons.io.filefilter.TrueFileFilter;
  
  import com.tecsys.sm.util.WindowsDirectories;
  
  public class ApacheListOfFiles {
  public static void main(String[] args){
      final String envName= "test_trunkcpsm";
      WindowsDirectories wd = new WindowsDirectories();
      File startPath =  new File(wd.getStartMenuDir()+File.separator+"Programs");
      Collection&lt;File&gt; listF = FileUtils.listFiles(startPath, new IOFileFilter() {
  
      @Override
      public boolean accept(File dir, String name) {
  
          return false;
      }
  
      @Override
      public boolean accept(File file) {
          // TODO Auto-generated method stub
  
          if(file.getName().contains(envName)){
              System.out.println(file);
              return true;
          }else
          return false;
      }
  },TrueFileFilter.INSTANCE);
  System.out.println(listF.size());
  Iterator&lt;File&gt; it = listF.iterator();
  while(it.hasNext()){
      System.out.println("Le fichier est : "+it.next());
  }
  }
  }
  </code></pre>
  
  <p>The output of this is the following:</p>
  
  <blockquote>
    <p>C:\ProgramData\Microsoft\Windows\Start Menu\Programs\TECSYS\iTopia Environments\test_trunkcpsm
    0</p>
  </blockquote>
  
  <p>So he finds the file i am searching for but still return an empty list, why is that ? And also while we are at it, when is the first accept called ? i have some difficulties understanding how this class works.</p>