I have a WatchService implementation where the service watches for the directory using key = watchService.poll()
or take()
methods.. But issue I am facing is, what if I have some files already present into the watch directory before starting poll()
or take()
method. WatchService unable to track those. How do I get those files under a directory? Is there anything WatchService provides to achieve this? Or any other solution to this challenge?
Thanks in advance!