Class Scanner
java.lang.Object
org.glassfish.pfl.basic.tools.file.Scanner
Recursively scan directories to process files.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceAction interface passed to scan method to act on files. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddDirectoryToSkip(String pattern) Add a pattern that defines a directory to skip.booleanscan(Scanner.Action action) Scan all files reachable from roots.
-
Constructor Details
-
Scanner
-
Scanner
-
-
Method Details
-
addDirectoryToSkip
Add a pattern that defines a directory to skip. We only need really simple patterns: just a single name that must match a component of a directory name exactly. -
scan
Scan all files reachable from roots. Does a depth-first search. Ignores all directories (and their contents) that match an entry in patternsToSkip. Passes each file (not directories) to the action. If action returns false, scan terminates. The result of the scan is the result of the last action call.- Throws:
IOException
-