Package de.galan.commons.io.file
Class FilesystemObserver
java.lang.Object
de.galan.commons.io.file.FilesystemObserver
File- and DirectoryListener can be registered at the observer to recevive notifications if they change. Uses
internally the WatchService.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected Threadprotected voidnotifyDirectoryListener(de.galan.commons.io.file.ProxyDirectoryListener proxyDirectoryListener, WatchEvent.Kind<?> kind, Path path) protected voidnotifyFileListener(de.galan.commons.io.file.ProxyFileListener fileListener, WatchEvent.Kind<?> kind, Path path) protected voidvoidregisterDirectoryListener(FileListener directoryListener, File directory, boolean recursive) protected voidregisterDirectoryListener(FileListener directoryListener, Path directory, boolean recursive) protected voidregisterDirectoryListenerInternal(de.galan.commons.io.file.ProxyDirectoryListener proxyDirectoryListener) voidregisterFileListener(FileListener fileListener, File file) voidstart()voidstop()
-
Constructor Details
-
FilesystemObserver
public FilesystemObserver()
-
-
Method Details
-
createWatcherThread
-
start
public void start() -
stop
public void stop() -
processEvents
protected void processEvents() -
notifyDirectoryListener
protected void notifyDirectoryListener(de.galan.commons.io.file.ProxyDirectoryListener proxyDirectoryListener, WatchEvent.Kind<?> kind, Path path) -
notifyFileListener
protected void notifyFileListener(de.galan.commons.io.file.ProxyFileListener fileListener, WatchEvent.Kind<?> kind, Path path) -
registerFileListener
- Throws:
IOException
-
registerDirectoryListener
public void registerDirectoryListener(FileListener directoryListener, File directory, boolean recursive) throws IOException - Throws:
IOException
-
registerDirectoryListener
protected void registerDirectoryListener(FileListener directoryListener, Path directory, boolean recursive) throws IOException - Throws:
IOException
-
registerDirectoryListenerInternal
protected void registerDirectoryListenerInternal(de.galan.commons.io.file.ProxyDirectoryListener proxyDirectoryListener) throws IOException - Throws:
IOException
-