Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

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

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

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 


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]
 

void alma::acs::config::validators::ConfigFileFinder::configureFromArgs String[]  args  )  [inline]
 

void alma::acs::config::validators::ConfigFileFinder::configureRedeemers  )  throws Exception [inline]
 

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

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:

void alma::acs::config::validators::ConfigFileFinder::runRecursive File  currentDir,
FileFilter  fileFilter
[inline, private]
 

void alma::acs::config::validators::ConfigFileFinder::setBaseDir File  baseDir  )  [inline, protected]
 

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


Member Data Documentation

File alma::acs::config::validators::ConfigFileFinder::baseDir [private]
 

directory under which we look for config files

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

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

Logger alma::acs::config::validators::ConfigFileFinder::logger [private]
 

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

File alma::acs::config::validators::ConfigFileFinder::targetDir [private]
 

optional target dir to which suspected config files are copied

boolean alma::acs::config::validators::ConfigFileFinder::targetFilesFlat [private]
 

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


The documentation for this class was generated from the following file:
Generated on Thu Apr 30 02:52:21 2009 for ACS Java API by doxygen 1.3.8