org.jcomet.core
Class FileMonitor

java.lang.Object
  extended byorg.jcomet.core.FileMonitor

public class FileMonitor
extends java.lang.Object

Monitors a file and notifys you when it has changed

Author:
Amir Shevat

Constructor Summary
FileMonitor(java.io.File file, FileChangeListener listener, long period)
          Monitors a file and notifys you when it has changed
 
Method Summary
protected  void fireFileChangeEvent(FileChangeListener listener, java.io.File file)
           
 void stop()
          stops the monitoring
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileMonitor

public FileMonitor(java.io.File file,
                   FileChangeListener listener,
                   long period)
Monitors a file and notifys you when it has changed

Parameters:
file - the file to be monitored
listener - the listener to be notified
period - the interval in which to check the file
Method Detail

stop

public void stop()
stops the monitoring


fireFileChangeEvent

protected void fireFileChangeEvent(FileChangeListener listener,
                                   java.io.File file)
                            throws java.io.IOException
Throws:
java.io.IOException


Copyright spacebug Open source initiative (www.spacebug.com). Amir Shevat