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() |
java.util.List<java.io.File> |
getHitList() |
java.util.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(java.lang.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,
java.io.IOException exc) |
public java.nio.file.PathMatcher getDirMatcher()
public java.nio.file.PathMatcher getFileMatcher()
public java.util.List<java.io.File> getHitList()
public java.util.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 java.io.IOException
preVisitDirectory in interface java.nio.file.FileVisitor<java.nio.file.Path>preVisitDirectory in class java.nio.file.SimpleFileVisitor<java.nio.file.Path>java.io.IOExceptionpublic 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(java.lang.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 java.io.IOException
visitFile in interface java.nio.file.FileVisitor<java.nio.file.Path>visitFile in class java.nio.file.SimpleFileVisitor<java.nio.file.Path>java.io.IOExceptionpublic java.nio.file.FileVisitResult visitFileFailed(java.nio.file.Path file,
java.io.IOException exc)
throws java.io.IOException
visitFileFailed in interface java.nio.file.FileVisitor<java.nio.file.Path>visitFileFailed in class java.nio.file.SimpleFileVisitor<java.nio.file.Path>java.io.IOExceptionCopyright © 1995–2023 Webtide. All rights reserved.