Class RecursiveFileSearch

java.lang.Object
edu.umd.cs.findbugs.RecursiveFileSearch

public class RecursiveFileSearch extends Object
Recursively search a directory, its subdirectories, etc. Note that the search algorithm uses a worklist, so its implementation does not use recursive method calls.
Author:
David Hovemeyer
  • Constructor Details

    • RecursiveFileSearch

      public RecursiveFileSearch(String baseDir, FileFilter fileFilter)
      Constructor.
      Parameters:
      baseDir - the base directory for the search
      fileFilter - chooses files to add to the results, and subdirectories to continue the search in
  • Method Details

    • search

      public RecursiveFileSearch search() throws InterruptedException
      Perform the search.
      Returns:
      this object
      Throws:
      InterruptedException - if the thread is interrupted before the search completes
    • fileNameIterator

      public Iterator<String> fileNameIterator()
      Get an iterator over the files found by the search. The full path names of the files are returned.
    • getDirectoriesScanned

      public List<String> getDirectoriesScanned()