addFileSetCheck
public void addFileSetCheck(FileSetCheck aFileSetCheck)
Adds a FileSetCheck to the list of FileSetChecks
that is executed in process().
aFileSetCheck
- the additional FileSetCheck
addFilter
public void addFilter(Filter aFilter)
Adds a filter to the end of the audit event filter chain.
aFilter
- the additional filter
addListener
public void addListener(AuditListener aListener)
Add the listener that will be used to receive events from the audit.
aListener
- the nosy thing
destroy
public void destroy()
Cleans up the object. *
fireAuditFinished
protected void fireAuditFinished()
notify all listeners about the audit end
fireAuditStarted
protected void fireAuditStarted()
notify all listeners about the audit start
fireErrors
public void fireErrors(String aFileName,
LocalizedMessage[] aErrors)
notify all listeners about the errors in a file.
- fireErrors in interface MessageDispatcher
aFileName
- the audited fileaErrors
- the audit errors from the file
fireFileFinished
public void fireFileFinished(String aFileName)
Notify all listeners about the end of a file audit.
- fireFileFinished in interface MessageDispatcher
aFileName
- the audited file
fireFileStarted
public void fireFileStarted(String aFileName)
Notify all listeners about the beginning of a file audit.
- fireFileStarted in interface MessageDispatcher
aFileName
- the file to be audited
getBasedir
public final String getBasedir()
- the base directory property used in unit-test.
normalize
public String normalize(String aPath)
"normalize" the given absolute path.
This includes:
- Uppercase the drive letter if there is one.
- Remove redundant slashes after the drive spec.
- resolve all ./, .\, ../ and ..\ sequences.
- DOS style paths that start with a drive letter will have
\ as the separator.
aPath
- a path for "normalizing"
process
public int process(File[] aFiles)
Processes a set of files with all FileSetChecks.
Once this is done, it is highly recommended to call for
the destroy method to close and remove the listeners.
aFiles
- the list of files to be audited.
- the total number of errors found
removeFilter
public void removeFilter(Filter aFilter)
Removes filter.
aFilter
- filter to remove.
removeListener
public void removeListener(AuditListener aListener)
Removes a given listener.
aListener
- a listener to remove
setBasedir
public void setBasedir(String aBasedir)
aBasedir
- the base directory to strip off in filenames
setClassloader
public final void setClassloader(ClassLoader aLoader)
Sets the classloader that is used to contextualize filesetchecks.
Some Check implementations will use that classloader to improve the
quality of their reports, e.g. to load a class and then analyze it via
reflection.
aLoader
- the new classloader
setLocaleCountry
public void setLocaleCountry(String aLocaleCountry)
aLocaleCountry
- the country to report messages *
setLocaleLanguage
public void setLocaleLanguage(String aLocaleLanguage)
aLocaleLanguage
- the language to report messages *
setModuleFactory
public void setModuleFactory(ModuleFactory aModuleFactory)
Sets the factory for creating submodules.
aModuleFactory
- the factory for creating FileSetChecks
setSeverity
public final void setSeverity(String aSeverity)
Sets the severity level. The string should be one of the names
defined in the SeverityLevel
class.
aSeverity
- The new severity level