Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

buildtools
Class FileChangeMonitor  view FileChangeMonitor download FileChangeMonitor.java

java.lang.Object
  extended bybuildtools.FileChangeMonitor

public class FileChangeMonitor
extends java.lang.Object

Provides a way to determine if files in a directory have changed.

Version:
$Id: FileChangeMonitor.java,v 1.2 1999/12/12 17:53:27 burton Exp $

Nested Class Summary
 class FileChangeMonitor.MonitoredFile
           
 
Field Summary
private  java.lang.String directory
           
private  java.lang.String[] extensions
           
private  java.util.Hashtable files
          A list of files and their modification times.
 
Constructor Summary
FileChangeMonitor(java.lang.String directory, java.lang.String[] extensions)
          Looks at the given directory and all files underneath only matching the given extensions.
 
Method Summary
 void check()
          Checks the new modification times of registered files.
 java.lang.String[] getAllFiles()
          Returns all files that are being monitored.
 java.lang.String[] getChangedFiles()
          Returns the files that have been changed for this monitor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

files

private java.util.Hashtable files
A list of files and their modification times. The


directory

private java.lang.String directory

extensions

private java.lang.String[] extensions
Constructor Detail

FileChangeMonitor

public FileChangeMonitor(java.lang.String directory,
                         java.lang.String[] extensions)
Looks at the given directory and all files underneath only matching the given extensions.

Method Detail

getChangedFiles

public java.lang.String[] getChangedFiles()
Returns the files that have been changed for this monitor.


getAllFiles

public java.lang.String[] getAllFiles()
Returns all files that are being monitored.


check

public void check()
Checks the new modification times of registered files. And sets their modification time to their new value. If any files were deleted, they are removed from the list, if any files are created, they are added to the list.