jfilewatcher Code
Brought to you by:
mohdejaz
File | Date | Author | Commit |
---|---|---|---|
.settings | 2012-01-28 | mohdejaz | [r54] Removed src.jar |
META-INF | 2011-06-25 | mohdejaz | [r24] Final version. |
lib | 2012-10-28 | mohdejaz | [r74] + Using JRegex to support shell file name patterns |
nbproject | 2012-10-28 | mohdejaz | [r75] Simplify the command line args to jfilewatcher jar |
src | 2012-10-28 | mohdejaz | [r78] Using CopyOnWriteArrayList to collect all file ... |
.classpath | 2012-01-29 | mohdejaz | [r57] Changes - |
.project | 2012-01-28 | mohdejaz | [r54] Removed src.jar |
README.TXT | 2012-10-21 | mohdejaz | [r70] + JFileWatcherCache is not singleton |
build.xml | 2012-10-28 | mohdejaz | [r74] + Using JRegex to support shell file name patterns |
jfilewatcher is simple file watcher service written in Java. It uses the default polling method to check for new / modified / deleted files. It then sends events corresponding events. You can specify folder and multiple file patterns. It also provides a global lock facility to prevent multiple file watchers running at same time. Here's how you use it from command line ... java -cp lib/log4j.jar:dist/jfilewatcher-2.0.jar:. ejaz.jfilewatcher.core.JFileWatcherServices /home Here's how you use it programmatically ... JFileWatcherService fservice = new JFileWatcherService(); // If you want to watch specific files, // pass second arg as an array of Strings of regexp patterns fservice.watch(new File(args[0]), null); // Start file watcher service (it is a thread!) fservice.start();