Class BaseFileVisitor
- java.lang.Object
-
- java.nio.file.SimpleFileVisitor<Path>
-
- engineering.swat.watch.impl.overflows.BaseFileVisitor
-
- All Implemented Interfaces:
FileVisitor<Path>
- Direct Known Subclasses:
MemorylessRescanner.Generator
public class BaseFileVisitor extends SimpleFileVisitor<Path>
Base extension ofSimpleFileVisitor
, intended to be further specialized by subclasses to auto-handleWatchEvent.Kind.OVERFLOW
events. In particular, methodwalkFileTree()
of this class internally callsFiles.walkFileTree(java.nio.file.Path, java.util.Set<java.nio.file.FileVisitOption>, int, java.nio.file.FileVisitor<? super java.nio.file.Path>)
to visit the file tree that starts atpath
, with a maximum depth inferred fromscope
. Subclasses can be specialized, for instance, to generate synthetic events or index a file tree.
-
-
Field Summary
Fields Modifier and Type Field Description protected Path
path
protected WatchScope
scope
-
Constructor Summary
Constructors Constructor Description BaseFileVisitor(Path path, WatchScope scope)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FileVisitResult
postVisitDirectory(Path dir, IOException exc)
FileVisitResult
visitFileFailed(Path file, IOException exc)
void
walkFileTree()
-
Methods inherited from class java.nio.file.SimpleFileVisitor
preVisitDirectory, visitFile
-
-
-
-
Field Detail
-
path
protected final Path path
-
scope
protected final WatchScope scope
-
-
Constructor Detail
-
BaseFileVisitor
public BaseFileVisitor(Path path, WatchScope scope)
-
-
Method Detail
-
walkFileTree
public void walkFileTree()
-
visitFileFailed
public FileVisitResult visitFileFailed(Path file, IOException exc) throws IOException
- Specified by:
visitFileFailed
in interfaceFileVisitor<Path>
- Overrides:
visitFileFailed
in classSimpleFileVisitor<Path>
- Throws:
IOException
-
postVisitDirectory
public FileVisitResult postVisitDirectory(Path dir, IOException exc) throws IOException
- Specified by:
postVisitDirectory
in interfaceFileVisitor<Path>
- Overrides:
postVisitDirectory
in classSimpleFileVisitor<Path>
- Throws:
IOException
-
-