File
handling features that I use, it was a reminder that not everyone is so lucky to use Java 7. I remembered an example from Geosoft (I remembered it because I liked the name). I went looking and I found their example code FileMonitor.java. It is a simple and elegant solution to monitoring files and directories for changes.This is by no means a complete example, but does show a simple technique.
JDK 7 has problem with some filesystems like CIFS/SMB
ReplyDeleteSimple way is to use pooling implementation from OpenJDK
http://adnotacja.blogspot.com/2012/12/powiadamiacz-zgodny-z-jdk-7-ale-na.html
Thanks for the additional information.
ReplyDeleteThe target audience for this post though was the JDK 6 user who can not upgrade for any number of reasons. This technique will work on JDK 7, but there are better options available.
I have found some filesystem issues too with implementations. You mentioned CIFS/SMB, but I have found an incomplete implementation on my mac too.