Class PathFinder
- All Implemented Interfaces:
FileVisitor<Path>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Pathprivate PathMatcherprivate PathMatcherprivate boolean -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate voidgetHits()booleanpreVisitDirectory(Path dir, BasicFileAttributes attrs) voidSet the active basePath, used for resolving relative paths.voidsetDirMatcher(PathMatcher dirMatcher) voidsetFileMatcher(String pattern) voidsetFileMatcher(PathMatcher fileMatcher) voidsetIncludeDirsInResults(boolean includeDirsInResults) visitFile(Path file, BasicFileAttributes attrs) visitFileFailed(Path file, IOException exc) Methods inherited from class SimpleFileVisitor
postVisitDirectory
-
Field Details
-
NOTIFIED_PATHS
-
includeDirsInResults
private boolean includeDirsInResults -
hits
-
basePath
-
dirMatcher
-
fileMatcher
-
-
Constructor Details
-
PathFinder
public PathFinder()
-
-
Method Details
-
addHit
-
getDirMatcher
-
getFileMatcher
-
getHitList
-
getHits
-
isIncludeDirsInResults
public boolean isIncludeDirsInResults() -
preVisitDirectory
- Specified by:
preVisitDirectoryin interfaceFileVisitor<Path>- Overrides:
preVisitDirectoryin classSimpleFileVisitor<Path>- Throws:
IOException
-
setBase
Set the active basePath, used for resolving relative paths.When a hit arrives for a subsequent find that has the same relative path as a prior hit, the new hit overrides the prior path as the active hit.
- Parameters:
basePath- the basePath to tag all hits with
-
setDirMatcher
-
setFileMatcher
-
setFileMatcher
-
setIncludeDirsInResults
public void setIncludeDirsInResults(boolean includeDirsInResults) -
visitFile
- Specified by:
visitFilein interfaceFileVisitor<Path>- Overrides:
visitFilein classSimpleFileVisitor<Path>- Throws:
IOException
-
visitFileFailed
- Specified by:
visitFileFailedin interfaceFileVisitor<Path>- Overrides:
visitFileFailedin classSimpleFileVisitor<Path>- Throws:
IOException
-