public class DirectoryWalker extends Walker implements IReportable
| Modifier and Type | Field and Description |
|---|---|
protected static FileNameComparator |
COMPARATOR |
| Constructor and Description |
|---|
DirectoryWalker(java.io.File file) |
DirectoryWalker(java.io.File file,
java.io.FilenameFilter filter)
Constructs a walker.
|
DirectoryWalker(java.io.File file,
java.util.regex.Pattern ignoreNameRegex) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
isRestricted() |
private void |
process(RatReport report,
java.io.File file)
Process a directory, ignoring any files/directories set to be ignored.
|
private void |
processDirectories(RatReport report,
java.io.File[] files)
Process all directories in a set of file objects, ignoring any directories set to be ignored.
|
private void |
processDirectory(RatReport report,
java.io.File file)
Process a directory, restricted directories will be ignored.
|
private void |
processNonDirectories(RatReport report,
java.io.File[] files)
Process all files in a set of file objects, ignoring any files set to be ignored.
|
private void |
report(RatReport report,
java.io.File file)
Report on the given file.
|
void |
run(RatReport report)
Run a report over all files and directories in this DirectoryWalker,
ignoring any files/directories set to be ignored.
|
isNotIgnored, isRestricted, regexFilterprotected static final FileNameComparator COMPARATOR
public DirectoryWalker(java.io.File file)
public DirectoryWalker(java.io.File file,
java.io.FilenameFilter filter)
file - not nullfilter - filters input files (optional),
or null when no filtering should be performedpublic DirectoryWalker(java.io.File file,
java.util.regex.Pattern ignoreNameRegex)
public boolean isRestricted()
private void processDirectory(RatReport report, java.io.File file) throws RatException
report - The report to process the directory withfile - the directory to processRatExceptionpublic void run(RatReport report) throws RatException
run in interface IReportablereport - the defined RatReport to run on this Directory walker.RatExceptionprivate void process(RatReport report, java.io.File file) throws RatException
report - the report to use in processingfile - the run the report againstRatExceptionprivate void processDirectories(RatReport report, java.io.File[] files) throws RatException
report - the report to use in processingfiles - the files to process (only directories will be processed)RatExceptionprivate void processNonDirectories(RatReport report, java.io.File[] files) throws RatException
report - the report to use in processingfiles - the files to process (only files will be processed)RatExceptionprivate void report(RatReport report, java.io.File file) throws RatException
report - the report to process the file withfile - the file to be reported onRatException