drapostolos / rdp4j

Remote Directory Poller for Java
MIT License
47 stars 25 forks source link

Persistence missing in directory poller #2

Closed ShwetaTurakhia closed 1 year ago

ShwetaTurakhia commented 9 years ago

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.

drapostolos commented 9 years 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

drapostolos commented 9 years ago

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

drapostolos commented 9 years ago

@ShwetaTurakhia can you confirm the behavior above? Is that what you expect? I think this is a valid concern.

drapostolos commented 3 years ago

This could partly be solved by #10

drapostolos commented 3 years ago

See PR #26 and PR #27

drapostolos commented 1 year ago

This has been fixed in version 0.3.0