Mario's Homepage - JFileWatch

Login

Main

Main
My Projects
Downloads

Travels
Dublin ApacheCon EU 2006

Recent Changes

Contact

Mario Ivankovits
mario (at) ops (dot) at


Twenty Minutes Into The Future
Geocacher
View my profile as others see me


JFileWatch

JFileWatch tries to provide a single api to filesystem events for various operating systems. It uses JNI to interact with the os api. In case of Linux I'd say its a rather complete implementation now.

The "move event" still has some limitations where I think it has something to do with limitations of inotify itself, have to have a look at it. Currently do not expect that the "move event" works in any other case than a simple "rename file" operation.

Installation

See included README.txt for installation instructions.

Download: JFileWatch-1.2-dev-src.jar
License: ASF 2.0
Javadoc: http://l3x.net/~im/JFileWatch/docs/api

Changelog

  • 1-2 2006-Sep-03: Support recursive watch of directories. Support MOVE_SELF event. Some bugfixes e.g. update internal datastructures in case of "moved files" and unwatch/remove events. Changed API to use java.io.File instead of String.
  • 1.1 2006-Sep-02: upgrade to kernel 2.6.16 (and maybe older ... dont know)
  • 1.0 2005-May-08: birthday

Example

The following example will recursively watch a directory.

        FileWatch fw = FileWatchFactory.create();
        fw.addWatch(new File("/home/im/tmp"), true);
        fw.addListener(new FileWatchEventListener()
        {
            public void processFileWatchEvent(FileWatchEvent evt)
            {
                System.err.println(evt);
            }
        });

You could attach multiple watches and listeners to a single fileWatch instance.

Currently supported OS

TODO

Volunteers wanted!!

  • support windows
  • support mac


Attachments
Filename Info Size
JFileWatch-1.0-dev-src.jar Info on JFileWatch-1.0-dev-src.jar 137408 bytes
JFileWatch-1.1-dev-src.jar Info on JFileWatch-1.1-dev-src.jar 137526 bytes
JFileWatch-1.2-dev-src.jar Info on JFileWatch-1.2-dev-src.jar 139377 bytes
Comment this page
This page last changed on 03-Sep-2006 19:42:39 CEST by im.
Contact: im-at-l3x-dot-net