Package com.swoval.files
Interface RegisterableWatchService
-
- All Superinterfaces:
java.lang.AutoCloseable,java.io.Closeable,java.nio.file.WatchService
public interface RegisterableWatchService extends java.nio.file.WatchServiceAugments the java.nio.file.WatchService with aregister(java.nio.file.Path, java.nio.file.WatchEvent.Kind<?>...)method. This is because Path.register does not work on custom watch services.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.nio.file.WatchKeyregister(java.nio.file.Path path, java.nio.file.WatchEvent.Kind<?>... kinds)Register a path for monitoring.
-
-
-
Method Detail
-
register
java.nio.file.WatchKey register(java.nio.file.Path path, java.nio.file.WatchEvent.Kind<?>... kinds) throws java.io.IOExceptionRegister a path for monitoring.- Parameters:
path- The path to monitor.kinds- The types of events to monitor.- Returns:
- WatchKey the key returned by the WatchService
- Throws:
java.io.IOException- when the path cannot be registered
-
-