Closed ShwetaTurakhia closed 1 year ago
Sorry for the late reply. I missed this in my mail box. Please submit a pull request and I'll have a look at it.
/Alex
Is this the behavior you would like?
When you call DirectoryPoller.stop(); your polled directory may contain these files: --- file1 --- file2 --- file3
When you start the the DirectoryPoller again, your polled directory may contain these files: --- file1 --- file2 (same file, but modified) --- file4 --- file5
then you would like to get these events: fileAdded: file4, file5 fileRemoved: file3 fileModified: file2
@ShwetaTurakhia can you confirm the behavior above? Is that what you expect? I think this is a valid concern.
This could partly be solved by #10
See PR #26 and PR #27
This has been fixed in version 0.3.0
The "previous list" in Poller.java used by the comparator for finding any new files added, is not persisted anywhere. So if the service is restarted. It will forget the files it has see before and will repopulate the prev list with the current list and hence not find anything that got added during that time.
Please let me know if this is a valid concern. I would like to fix this issue and send a cr.