Class FileScanner
- java.lang.Object
-
- com.g2forge.alexandria.java.concurrent.AThreadActor
-
- com.g2forge.alexandria.java.io.watch.FileScanner
-
- All Implemented Interfaces:
ICloseable
,Closeable
,AutoCloseable
public class FileScanner extends AThreadActor
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
FileScanner.Event
-
Nested classes/interfaces inherited from class com.g2forge.alexandria.java.concurrent.AThreadActor
AThreadActor.State
-
-
Field Summary
Fields Modifier and Type Field Description protected Set<Path>
directories
protected IConsumer1<Throwable>
errorHandler
protected IConsumer1<FileScanner.Event>
handler
protected LinkedHashSet<FileScanner.Event>
queue
protected boolean
reportOnScan
protected boolean
reportUnsupportedWatch
protected Map<Path,ICloseable>
scanned
A map of the directories we have scanned, so that we can watch recursively, to their watcher controls.-
Fields inherited from class com.g2forge.alexandria.java.concurrent.AThreadActor
state, thread
-
-
Constructor Summary
Constructors Constructor Description FileScanner(IConsumer1<FileScanner.Event> handler, IConsumer1<Throwable> errorHandler, boolean reportOnScan, boolean reportUnsupportedWatch, Path... directories)
FileScanner(IConsumer1<FileScanner.Event> handler, IConsumer1<Throwable> errorHandler, boolean reportOnScan, boolean reportUnsupportedWatch, Set<Path> directories)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description FileScanner
open()
protected void
run()
protected void
scan(Path directory, FileWatcher watcher)
-
Methods inherited from class com.g2forge.alexandria.java.concurrent.AThreadActor
close, getState, isOpen, shutdown, waitClosed
-
-
-
-
Field Detail
-
handler
protected final IConsumer1<FileScanner.Event> handler
-
errorHandler
protected final IConsumer1<Throwable> errorHandler
-
reportOnScan
protected final boolean reportOnScan
-
reportUnsupportedWatch
protected final boolean reportUnsupportedWatch
-
queue
protected final LinkedHashSet<FileScanner.Event> queue
-
scanned
protected final Map<Path,ICloseable> scanned
A map of the directories we have scanned, so that we can watch recursively, to their watcher controls.
-
-
Constructor Detail
-
FileScanner
public FileScanner(IConsumer1<FileScanner.Event> handler, IConsumer1<Throwable> errorHandler, boolean reportOnScan, boolean reportUnsupportedWatch, Path... directories)
-
FileScanner
@ConstructorProperties({"handler","errorHandler","reportOnScan","reportUnsupportedWatch","directories"}) public FileScanner(IConsumer1<FileScanner.Event> handler, IConsumer1<Throwable> errorHandler, boolean reportOnScan, boolean reportUnsupportedWatch, Set<Path> directories)
-
-
Method Detail
-
open
public FileScanner open()
- Overrides:
open
in classAThreadActor
-
run
protected void run()
- Specified by:
run
in classAThreadActor
-
scan
protected void scan(Path directory, FileWatcher watcher)
-
-