public class DirectoryWatcher
extends java.lang.Object
| Constructor and Description |
|---|
DirectoryWatcher(java.util.List<java.nio.file.Path> paths,
DirectoryChangeListener listener,
java.nio.file.WatchService watchService,
org.slf4j.Logger logger) |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
static DirectoryWatcher |
create(java.util.List<java.nio.file.Path> paths,
DirectoryChangeListener listener,
org.slf4j.Logger logger) |
static DirectoryWatcher |
create(java.nio.file.Path path,
DirectoryChangeListener listener,
org.slf4j.Logger logger) |
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,
DirectoryChangeListener listener,
java.nio.file.WatchService watchService,
org.slf4j.Logger logger)
throws java.io.IOException
java.io.IOExceptionpublic static DirectoryWatcher create(java.nio.file.Path path, DirectoryChangeListener listener, org.slf4j.Logger logger) throws java.io.IOException
java.io.IOExceptionpublic static DirectoryWatcher create(java.util.List<java.nio.file.Path> paths, DirectoryChangeListener listener, org.slf4j.Logger logger) throws java.io.IOException
java.io.IOExceptionpublic java.util.concurrent.CompletableFuture<java.lang.Void> watchAsync()
public 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