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