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

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.lenya.ac.file.FileItemManager.DirectoryChangeNotifier
All Implemented Interfaces:
org.apache.avalon.framework.logger.LogEnabled
Enclosing class:
FileItemManager

public static class FileItemManager.DirectoryChangeNotifier
extends org.apache.avalon.framework.logger.AbstractLogEnabled

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 org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
 
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 © $ Apache Software Foundation. All Rights Reserved.