org.wamblee.io
Class DirectoryMonitor

java.lang.Object
  extended by org.wamblee.io.DirectoryMonitor

public class DirectoryMonitor
extends Object

Monitors a directory for changes. The currernt implementation only checks files not directories and does not check for modifications in subdirectories.

Author:
Erik Brakkee

Nested Class Summary
static interface DirectoryMonitor.Listener
          Listener interface to be provided by users of the directory monitor to get notified of changes.
 
Constructor Summary
DirectoryMonitor(File aDirectory, FileFilter aFilefilter, DirectoryMonitor.Listener aListener)
          Creates a new DirectoryMonitor object.
 
Method Summary
 void poll()
          Polls the directory for changes and notifies the listener of any changes.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DirectoryMonitor

public DirectoryMonitor(File aDirectory,
                        FileFilter aFilefilter,
                        DirectoryMonitor.Listener aListener)
Creates a new DirectoryMonitor object.

Method Detail

poll

public void poll()
Polls the directory for changes and notifies the listener of any changes. In case of any exceptions thrown by the listener while handling the changes, the next call to this method will invoked the listeners again for the same changes.



Copyright © 2011. All Rights Reserved.