alma::acs::config::validators::ConfigFileFinder Class Reference

Collaboration diagram for alma::acs::config::validators::ConfigFileFinder:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 ConfigFileFinder () throws Exception
void configureRedeemers () throws Exception
void addRedeemer (ConfigFileRedeemer redeemer)
void configureFromArgs (String[] args)
void checkConfiguration () throws IllegalStateException

Static Public Member Functions

static void main (String[] args)

Protected Member Functions

void handleConfigFile (File configFile)
void setBaseDir (File baseDir)
void setTargetDir (File targetDir)
void addFileEndings (String[] moreFileEndings)

Private Member Functions

void run ()
void runRecursive (File currentDir, FileFilter fileFilter)

Private Attributes

Logger logger
File baseDir
File targetDir
Set< String > fileEndings = new HashSet<String>()
boolean targetFilesFlat
List< ConfigFileRedeemerredeemers = new ArrayList<ConfigFileRedeemer>()

Detailed Description

Tool that scans modules (or all of ALMA software) for files that may be configuration files and therefore should be considered for moving to a different location.

All files in and below the directory given by the option -baseDir are scanned. Those files with certain endings are suspected of being configuration files, but then some of these files get cleared if they are recognized by one of the filters which check all suspicious files. For example, a filter specialized in xml files will recognize those files used for ACS error definitions. All files that are still suspect after filtering will be reported, either by printing their pathname to stdout, or by copying them to a target directory if the -targetDir option is given.

Author:
hsommer

Constructor & Destructor Documentation

alma::acs::config::validators::ConfigFileFinder::ConfigFileFinder (  )  throws Exception [inline]
Exceptions:
Exception 

References addFileEndings(), logger, and targetFilesFlat.

Referenced by main().


Member Function Documentation

void alma::acs::config::validators::ConfigFileFinder::addFileEndings ( String[]  moreFileEndings  )  [inline, protected]
void alma::acs::config::validators::ConfigFileFinder::addRedeemer ( ConfigFileRedeemer  redeemer  )  [inline]
void alma::acs::config::validators::ConfigFileFinder::checkConfiguration (  )  throws IllegalStateException [inline]

References baseDir, fileEndings, and targetDir.

Referenced by main().

void alma::acs::config::validators::ConfigFileFinder::configureFromArgs ( String[]  args  )  [inline]
void alma::acs::config::validators::ConfigFileFinder::configureRedeemers (  )  throws Exception [inline]

References addRedeemer(), baseDir, and logger.

Referenced by main().

void alma::acs::config::validators::ConfigFileFinder::handleConfigFile ( File  configFile  )  [inline, protected]

References baseDir, logger, targetDir, and targetFilesFlat.

Referenced by runRecursive().

static void alma::acs::config::validators::ConfigFileFinder::main ( String[]  args  )  [inline, static]
void alma::acs::config::validators::ConfigFileFinder::run (  )  [inline, private]

Gets all Files under baseDir whose name ends with any of the Strings given in fileEndings, and runs them through the filter chain to suppress files of known and safe content.

Returns:

References baseDir, fileEndings, logger, redeemers, runRecursive(), targetDir, and targetFilesFlat.

Referenced by main().

void alma::acs::config::validators::ConfigFileFinder::runRecursive ( File  currentDir,
FileFilter  fileFilter 
) [inline, private]
void alma::acs::config::validators::ConfigFileFinder::setBaseDir ( File  baseDir  )  [inline, protected]

Referenced by configureFromArgs().

void alma::acs::config::validators::ConfigFileFinder::setTargetDir ( File  targetDir  )  [inline, protected]

Referenced by configureFromArgs().


Member Data Documentation

directory under which we look for config files

Referenced by checkConfiguration(), configureRedeemers(), handleConfigFile(), and run().

Set<String> alma::acs::config::validators::ConfigFileFinder::fileEndings = new HashSet<String>() [private]

endings of files to consider, e.g. {"xml", "properties"}

Referenced by addFileEndings(), checkConfiguration(), and run().

classes that can recognize specific suspect files and state that they are actually not config files

Referenced by addRedeemer(), run(), and runRecursive().

optional target dir to which suspected config files are copied

Referenced by checkConfiguration(), handleConfigFile(), and run().

should files be copied to targetDir flat, i.e. w/o subdir structure?

Referenced by ConfigFileFinder(), configureFromArgs(), handleConfigFile(), and run().


The documentation for this class was generated from the following file:

Generated by  doxygen 1.6.2