Class DiscoverSourceDirectories

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

public class DiscoverSourceDirectories extends Object
Based on the contents of the application directories/archives in a Project, and a "root" source directory (under which some number of "real" source directories may be located), scan to find the source directories containing the application's source files.
Author:
David Hovemeyer
  • Constructor Details

    • DiscoverSourceDirectories

      public DiscoverSourceDirectories()
      Constructor.
  • Method Details

    • setProject

      public void setProject(Project project)
      Set the Project for which we want to find source directories.
      Parameters:
      project - Project for which we want to find source directories
    • setRootSourceDirectory

      public void setRootSourceDirectory(String rootSourceDirectory)
      Set the "root" source directory: we expect all of the actual source directories to be underneath it.
      Parameters:
      rootSourceDirectory - the root source directory
    • setScanForNestedArchives

      public void setScanForNestedArchives(boolean scanForNestedArchives)
      Set whether or not to scan the project for nested archives (i.e., if there is a WAR or EAR file that contains jar files inside it.) Default is false.
      Parameters:
      scanForNestedArchives - true if nested archives should be scanned, false otherwise
    • setErrorLogger

      public void setErrorLogger(IErrorLogger errorLogger)
      Set the error logger to use to report errors during scanning. By default, a no-op error logger is used.
      Parameters:
      errorLogger - error logger to use to report errors during scanning
    • setProgress

      public void setProgress(DiscoverSourceDirectories.Progress progress)
      Set the progress callback to which scanning progress should be reported.
      Parameters:
      progress - the progress callback
    • getDiscoveredSourceDirectoryList

      public List<String> getDiscoveredSourceDirectoryList()
      Get the list of discovered source directories. These can be added to a Project.
      Returns:
      list of discovered source directories.
    • execute

      Execute the search for source directories.
      Throws:
      CheckedAnalysisException
      IOException
      InterruptedException
    • main

      public static void main(String[] args) throws IOException, CheckedAnalysisException, InterruptedException
      Just for testing.
      Throws:
      IOException
      CheckedAnalysisException
      InterruptedException