Real'sHowTo AddThis Feed Button
Custom Search

File/directory polling to detect changeTag(s): IO Open Source


jpoller (directory poller)

http://jpoller.sourceforge.net/

A general purpose Java component to enable polling on directories and aysnchronously notify client code of incoming files. It's instrumented via JMX and controllable (also) via a JMX agent, like JBoss' JMX console.

JNotify

http://jnotify.sourceforge.net/

JNotify is a java library that allow java application to listen to file system events. JNotify works on both Windows (Windows 2000, XP, Vista) and Linux with INotify support (Kernel 2.6.14 and above).

Java Native Access (JNA)

https://jna.dev.java.net/

The goal of the JNA project is to let you access native code from Java while avoiding C and the Java Native Interface.

One example provides notification of file system changes using the mechanism provided by the OS. FileMonitor.java

Javaworld article about JNA

Call native methods in a DLL from Java (NativeCall)

http://johannburkard.de/blog/programming/java/Call-native-methods-in-a-DLL-from-Java-without-JNI.html

In this blog entry, the package NativeCall is used to call the Windows API to get notification about modification in given folder.

Java 7

Java 7 provides a mechanism to get notificaton on file change without polling (JSR 203).

http://blogs.sun.com/thejavatutorials/entry/watching_a_directory_for_changes

The simple (and naive!) approach

Detect file modification

Using Threads and file lookup at regular interval.


blog comments powered by Disqus


If you find this article useful, consider making a small donation
to show your support for this Web site and its content.

Written and compiled by Réal Gagnon ©1998-2014
[ home ]