com.darylteo.nio.PollingDirectoryWatchService Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of directory-watcher Show documentation
Show all versions of directory-watcher Show documentation
Watch and receive notifications on filesystem changes using Java 7 NIO's WatchService
The newest version!
package com.darylteo.nio;
import java.io.IOException;
/**
*
* This implementation of DirectoryWatchService provides a mechanism for polling for changes.
*
*
* @author Daryl Teo
* @see AbstractDirectoryWatchService
* @see DirectoryWatcher
*/
public class PollingDirectoryWatchService extends AbstractDirectoryWatchService {
public PollingDirectoryWatchService() throws IOException {
super();
}
/**
* Notifies all subscribers or any file system changes (if any)
*/
public void poll() {
super.handleWatchKey(super.getWatchService().poll());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy