Skip to content
Advertisement

Tag: watchservice

Using WatchService in JAVA. Can I watch subdirectory at the same time?

In JAVA I will watch directory by using WatchService. For example if I watch /users/monitor, WatchService can watch only one directory. But I wanna watch every subdirectory ‘at the same time’ How can I code? T_T —————————code——————————- —————————code——————————- Answer You can register multiple directories to the same directory watcher. Depending upon how the sub directory is created. If the directory

Advertisement