| Modifier and Type | Field and Description |
|---|---|
static Runnable |
EMPTY_CALLBACK |
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Stops the scanner thread which observes the watched directories for changes.
|
void |
destinationChanged(ch.sourcepond.io.fileobserver.spi.WatchedDirectory pWatchedDirectory,
Path pPrevious) |
void |
forceInform(EventDispatcher pDispatcher)
Iterates through all registered directories and passes all their files to the
PathChangeListener.modified(PathChangeEvent) of the observer specified. |
Directory |
getDirectory(Path pPath) |
void |
registerRootDirectory(ch.sourcepond.io.fileobserver.spi.WatchedDirectory pWatchedDirectory)
This method is not thread-safe and must be synchronized externally.
|
void |
run() |
void |
start()
Starts the scanner thread which observes the watched directories for changes.
|
String |
toString() |
void |
unregisterRootDirectory(Path pToBeUnregistered,
ch.sourcepond.io.fileobserver.spi.WatchedDirectory pWatchedDirectory)
This method is not thread-safe and must be synchronized externally.
|
public static final Runnable EMPTY_CALLBACK
public void forceInform(EventDispatcher pDispatcher)
Iterates through all registered directories and passes all their files to the
PathChangeListener.modified(PathChangeEvent) of the observer specified. This is necessary for newly registered
observers who need to know about all watched files. See registerRootDirectory(EventDispatcher, WatchedDirectory) and
PathChangeHandler.pathModified(EventDispatcher, Path, Runnable, boolean) to get an idea how directories are registered with this object.
Note: it's guaranteed that the Path instances passed
to the observer are regular files (not directories).
public void registerRootDirectory(ch.sourcepond.io.fileobserver.spi.WatchedDirectory pWatchedDirectory)
throws IOException
pWatchedDirectory - IOExceptionpublic void unregisterRootDirectory(Path pToBeUnregistered, ch.sourcepond.io.fileobserver.spi.WatchedDirectory pWatchedDirectory)
pWatchedDirectory - public void destinationChanged(ch.sourcepond.io.fileobserver.spi.WatchedDirectory pWatchedDirectory,
Path pPrevious)
throws IOException
IOExceptionpublic void close()
Stops the scanner thread which observes the watched directories for changes.
This must be named "stop" in order to be called from Felix DM (see Dependency Manager - Components)
close in interface Closeableclose in interface AutoCloseablepublic void start()
Starts the scanner thread which observes the watched directories for changes.
This must be named "start" in order to be called from Felix DM (see Dependency Manager - Components)
Copyright © 2017 SourcePond. All rights reserved.