public class PathFinder extends SimpleFileVisitor<Path>
Constructor and Description |
---|
PathFinder() |
Modifier and Type | Method and Description |
---|---|
PathMatcher |
getDirMatcher() |
PathMatcher |
getFileMatcher() |
List<File> |
getHitList() |
Collection<Path> |
getHits() |
boolean |
isIncludeDirsInResults() |
FileVisitResult |
preVisitDirectory(Path dir,
BasicFileAttributes attrs) |
void |
setBase(Path basePath)
Set the active basePath, used for resolving relative paths.
|
void |
setDirMatcher(PathMatcher dirMatcher) |
void |
setFileMatcher(PathMatcher fileMatcher) |
void |
setFileMatcher(String pattern) |
void |
setIncludeDirsInResults(boolean includeDirsInResults) |
FileVisitResult |
visitFile(Path file,
BasicFileAttributes attrs) |
FileVisitResult |
visitFileFailed(Path file,
IOException exc) |
postVisitDirectory
public PathMatcher getDirMatcher()
public PathMatcher getFileMatcher()
public Collection<Path> getHits()
public boolean isIncludeDirsInResults()
public FileVisitResult preVisitDirectory(Path dir, BasicFileAttributes attrs) throws IOException
preVisitDirectory
in interface FileVisitor<Path>
preVisitDirectory
in class SimpleFileVisitor<Path>
IOException
public void setBase(Path basePath)
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.
basePath
- the basePath to tag all hits withpublic void setDirMatcher(PathMatcher dirMatcher)
public void setFileMatcher(PathMatcher fileMatcher)
public void setFileMatcher(String pattern)
public void setIncludeDirsInResults(boolean includeDirsInResults)
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException
visitFile
in interface FileVisitor<Path>
visitFile
in class SimpleFileVisitor<Path>
IOException
public FileVisitResult visitFileFailed(Path file, IOException exc) throws IOException
visitFileFailed
in interface FileVisitor<Path>
visitFileFailed
in class SimpleFileVisitor<Path>
IOException
Copyright © 1995-2015 Webtide. All Rights Reserved.