Package org.eclipse.jetty.start
Class PathFinder
- java.lang.Object
-
- java.nio.file.SimpleFileVisitor<java.nio.file.Path>
-
- org.eclipse.jetty.start.PathFinder
-
- All Implemented Interfaces:
java.nio.file.FileVisitor<java.nio.file.Path>
public class PathFinder extends java.nio.file.SimpleFileVisitor<java.nio.file.Path>
-
-
Field Summary
Fields Modifier and Type Field Description private java.nio.file.Path
basePath
private java.nio.file.PathMatcher
dirMatcher
private java.nio.file.PathMatcher
fileMatcher
private java.util.Map<java.lang.String,java.nio.file.Path>
hits
private boolean
includeDirsInResults
private static java.util.Set<java.nio.file.Path>
NOTIFIED_PATHS
-
Constructor Summary
Constructors Constructor Description PathFinder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
addHit(java.nio.file.Path path)
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.lang.String pattern)
void
setFileMatcher(java.nio.file.PathMatcher fileMatcher)
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)
-
-
-
Field Detail
-
NOTIFIED_PATHS
private static java.util.Set<java.nio.file.Path> NOTIFIED_PATHS
-
includeDirsInResults
private boolean includeDirsInResults
-
hits
private java.util.Map<java.lang.String,java.nio.file.Path> hits
-
basePath
private java.nio.file.Path basePath
-
dirMatcher
private java.nio.file.PathMatcher dirMatcher
-
fileMatcher
private java.nio.file.PathMatcher fileMatcher
-
-
Method Detail
-
addHit
private void addHit(java.nio.file.Path path)
-
getDirMatcher
public java.nio.file.PathMatcher getDirMatcher()
-
getFileMatcher
public java.nio.file.PathMatcher getFileMatcher()
-
getHitList
public java.util.List<java.io.File> getHitList()
-
getHits
public java.util.Collection<java.nio.file.Path> getHits()
-
isIncludeDirsInResults
public boolean isIncludeDirsInResults()
-
preVisitDirectory
public java.nio.file.FileVisitResult preVisitDirectory(java.nio.file.Path dir, java.nio.file.attribute.BasicFileAttributes attrs) throws java.io.IOException
- Specified by:
preVisitDirectory
in interfacejava.nio.file.FileVisitor<java.nio.file.Path>
- Overrides:
preVisitDirectory
in classjava.nio.file.SimpleFileVisitor<java.nio.file.Path>
- Throws:
java.io.IOException
-
setBase
public void setBase(java.nio.file.Path basePath)
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
public void setDirMatcher(java.nio.file.PathMatcher dirMatcher)
-
setFileMatcher
public void setFileMatcher(java.nio.file.PathMatcher fileMatcher)
-
setFileMatcher
public void setFileMatcher(java.lang.String pattern)
-
setIncludeDirsInResults
public void setIncludeDirsInResults(boolean includeDirsInResults)
-
visitFile
public java.nio.file.FileVisitResult visitFile(java.nio.file.Path file, java.nio.file.attribute.BasicFileAttributes attrs) throws java.io.IOException
- Specified by:
visitFile
in interfacejava.nio.file.FileVisitor<java.nio.file.Path>
- Overrides:
visitFile
in classjava.nio.file.SimpleFileVisitor<java.nio.file.Path>
- Throws:
java.io.IOException
-
visitFileFailed
public java.nio.file.FileVisitResult visitFileFailed(java.nio.file.Path file, java.io.IOException exc) throws java.io.IOException
- Specified by:
visitFileFailed
in interfacejava.nio.file.FileVisitor<java.nio.file.Path>
- Overrides:
visitFileFailed
in classjava.nio.file.SimpleFileVisitor<java.nio.file.Path>
- Throws:
java.io.IOException
-
-