WatchService-based DirectoryWatcher (à la Apache Commons IO FileMonitor)
Opened this issue · 4 comments
Perhaps people would find it useful to find a utility to watch for file changes in Guava? I would have. ;-)
Apache Commons IO had a FileMonitor; that was based on polling files from a background thread. I just published something similar, but mine is based on the modern Java 7 JDK's WatchService instead, see http://blog2.vorburger.ch/2015/04/java-7-watchservice-based.html; DirectoryWatcher etc. src currently part of https://github.com/vorburger/HoTea - if this is of any interest, do let me know here; no offense taken either if you close this as N/A.
Currently Guava is targeted at JDK6, so it can't use anything from JDK7. This is something we could consider in the future though.
@cgdecker now that we have java8 specific code, should we bring this to API review?
@ronshapiro @cgdecker I'm still alive and if there's any interest for this, would be willing to raise a PR proposing to contribute a starting point for such a thing based on (above) from what I had done in https://github.com/vorburger/HoTea/tree/master/ch.vorburger.hotea/src/main/java/ch/vorburger/hotea/watchdir - I'm sure it would deserve to be torn apart, but could be starting point to kick this off.