Is there a way to monitor folders in java to see when they are updated, ie file created, deleted, renamed,etc. And also is there any way to set it that it only looks for files that begin with a certain prefix, ie img?
+4
A:
See my answer to a similar question.
The mechanisms detailed won't filter on a file name/type. You'll have to do that alongside the suggested solutions.
Brian Agnew
2009-08-11 09:57:54
+3
A:
In Java 7 there'll be a WatchService
API as part of NIO2. For previous/existing Java versions there's no pure Java solution except for manual polling.
Joachim Sauer
2009-08-11 09:59:30