org.apache.lenya.ac.file
Class FileItemManager.DirectoryChangeNotifier

java.lang.Object
  extended by org.apache.lenya.ac.file.FileItemManager.DirectoryChangeNotifier
Enclosing class:
FileItemManager

public static class FileItemManager.DirectoryChangeNotifier
extends java.lang.Object

Helper class to observe a directory for changes.


Constructor Summary
FileItemManager.DirectoryChangeNotifier(java.io.File directory, java.io.FileFilter filter)
          Ctor.
 
Method Summary
 java.io.File[] getAddedFiles()
          Returns the added files.
 java.io.File[] getChangedFiles()
          Returns the changed files.
 java.io.File[] getRemovedFiles()
          Returns the removed files.
 boolean hasChanged()
          Checks if the directory has changed (a new file was added, a file was removed, a file has changed).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileItemManager.DirectoryChangeNotifier

public FileItemManager.DirectoryChangeNotifier(java.io.File directory,
                                               java.io.FileFilter filter)
Ctor.

Parameters:
directory - The directory to observe.
filter - A filter to specify the file type to observe.
Method Detail

hasChanged

public boolean hasChanged()
                   throws java.io.IOException
Checks if the directory has changed (a new file was added, a file was removed, a file has changed).

Returns:
A boolean value.
Throws:
java.io.IOException - when something went wrong.

getAddedFiles

public java.io.File[] getAddedFiles()
Returns the added files.

Returns:
An array of files.

getRemovedFiles

public java.io.File[] getRemovedFiles()
Returns the removed files.

Returns:
An array of files.

getChangedFiles

public java.io.File[] getChangedFiles()
Returns the changed files.

Returns:
An array of files.


Copyright © 1999-2005 Apache Software Foundation. All Rights Reserved.