gmethvin / directory-watcher

A cross-platform Java recursive directory watcher, with a JNA macOS watcher and Scala better-files integration
Apache License 2.0
265 stars 34 forks source link

[JAVA] 0.9.3 Copy & Remove of folder structure does not produce CREATE events #37

Closed mangum99 closed 5 years ago

mangum99 commented 5 years ago

Steps to reproduce:

  1. Having following folder structure:
    • folder_parent
    • folder_child
  2. Copy this structure under folder where DirectoryWatcher is running
  3. Remove copied structure
  4. Copy again the structure -> now only CREATE Event for folder_parent was created
gmethvin commented 5 years ago

How is this issue different from #35? As I mentioned on that issue, I think we need to recursively remove the files in the directory from the hash map. The logic would be very similar to what we do for CREATE events. This way, when the directory is copied over the second time, the files will all be considered "new".