public class DirectoryWatcher
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
DirectoryWatcher.Builder
A builder for a
DirectoryWatcher. |
| Constructor and Description |
|---|
DirectoryWatcher(java.util.List<java.nio.file.Path> paths,
java.util.List<java.nio.file.Path> files,
DirectoryChangeListener listener,
java.nio.file.WatchService watchService,
FileHasher fileHasher,
org.slf4j.Logger logger) |
| Modifier and Type | Method and Description |
|---|---|
static DirectoryWatcher.Builder |
builder()
Get a new builder for a
DirectoryWatcher. |
void |
close() |
DirectoryChangeListener |
getListener() |
void |
watch()
Watch the directories.
|
java.util.concurrent.CompletableFuture<java.lang.Void> |
watchAsync()
Asynchronously watch the directories using
ForkJoinPool.commonPool() as the executor |
java.util.concurrent.CompletableFuture<java.lang.Void> |
watchAsync(java.util.concurrent.Executor executor)
Asynchronously watch the directories.
|
public DirectoryWatcher(java.util.List<java.nio.file.Path> paths,
java.util.List<java.nio.file.Path> files,
DirectoryChangeListener listener,
java.nio.file.WatchService watchService,
FileHasher fileHasher,
org.slf4j.Logger logger)
throws java.io.IOException
java.io.IOExceptionpublic static DirectoryWatcher.Builder builder()
DirectoryWatcher.public java.util.concurrent.CompletableFuture<java.lang.Void> watchAsync()
ForkJoinPool.commonPool() as the executorpublic java.util.concurrent.CompletableFuture<java.lang.Void> watchAsync(java.util.concurrent.Executor executor)
executor - the executor to use to watch asynchronouslypublic void watch()
public DirectoryChangeListener getListener()
public void close()
throws java.io.IOException
java.io.IOException