The watch service is incompatible with the LastModifiedFileListFilter. For e.g.
- If the LastModifiedFileListfilter is set to look for files at least 5 seconds old, and the poller is set to poll every 10 seconds.
- At the 9th second, a file could be created in the watched folder.
- At 10 seconds the poller queries the watch service to find out what changed in the past 10 seconds.
- It finds the newly created file.
- The newly created has a last modified time of -1 second, so it does not process it.
- At 20 seconds, the poller queries the watch service a second time, this time it does not see the unprocessed file as it was created more than 10 seconds ago.
Sample code below: