
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< ConfigFileRedeemer > | redeemers = new ArrayList<ConfigFileRedeemer>() |
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.
| alma::acs::config::validators::ConfigFileFinder::ConfigFileFinder | ( | ) | throws Exception [inline] |
| Exception |
References addFileEndings(), logger, and targetFilesFlat.
Referenced by main().
| void alma::acs::config::validators::ConfigFileFinder::addFileEndings | ( | String[] | moreFileEndings | ) | [inline, protected] |
References fileEndings.
Referenced by addRedeemer(), ConfigFileFinder(), and configureFromArgs().
| void alma::acs::config::validators::ConfigFileFinder::addRedeemer | ( | ConfigFileRedeemer | redeemer | ) | [inline] |
References addFileEndings(), alma::acs::config::validators::ConfigFileRedeemer::getFileEndings(), and redeemers.
Referenced by configureRedeemers().
| 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] |
References checkConfiguration(), ConfigFileFinder(), configureFromArgs(), configureRedeemers(), and run().
| 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.
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] |
References handleConfigFile(), alma::acs::config::validators::ConfigFileRedeemer::isNotAConfigFile(), logger, and redeemers.
Referenced by run().
| 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().
File alma::acs::config::validators::ConfigFileFinder::baseDir [private] |
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().
Logger alma::acs::config::validators::ConfigFileFinder::logger [private] |
Referenced by ConfigFileFinder(), configureRedeemers(), handleConfigFile(), run(), and runRecursive().
List<ConfigFileRedeemer> alma::acs::config::validators::ConfigFileFinder::redeemers = new ArrayList<ConfigFileRedeemer>() [private] |
classes that can recognize specific suspect files and state that they are actually not config files
Referenced by addRedeemer(), run(), and runRecursive().
File alma::acs::config::validators::ConfigFileFinder::targetDir [private] |
optional target dir to which suspected config files are copied
Referenced by checkConfiguration(), handleConfigFile(), and run().
boolean alma::acs::config::validators::ConfigFileFinder::targetFilesFlat [private] |
should files be copied to targetDir flat, i.e. w/o subdir structure?
Referenced by ConfigFileFinder(), configureFromArgs(), handleConfigFile(), and run().
1.6.2