jetbrains.buildServer.configuration
Class FilesWatcher

java.lang.Object
  extended by jetbrains.buildServer.configuration.ChangeObserver
      extended by jetbrains.buildServer.configuration.FilesWatcher
All Implemented Interfaces:
ChangeProvider

public class FilesWatcher
extends ChangeObserver
implements ChangeProvider

Watches for changes in files.


Nested Class Summary
static interface FilesWatcher.WatchedFilesProvider
          Allows to dynamically specify list of watched files/directories
 
Constructor Summary
FilesWatcher(FilesWatcher.WatchedFilesProvider filesProvider)
          Constructs files watcher from the specified watched files provider.
 
Method Summary
 boolean changesDetected()
          Computes whether files state has been changed.
 java.util.List<java.io.File> getModifiedFiles()
          Returns modified files
 java.util.List<java.io.File> getNewFiles()
          Returns files detected as new
 java.util.List<java.io.File> getRemovedFiles()
          Returns files detected as removed
 java.lang.String getRequestor()
          Returns (short) string representation of this change source
 void resetChanged()
          Takes current files state and remembers it.
 
Methods inherited from class jetbrains.buildServer.configuration.ChangeObserver
checkForModifications, clear, getSleepingPeriod, registerChangeProvider, registerListener, runActionWithDisabledObserver, setSkipListenersNotification, setSleepingPeriod, shutdownAll, start, stop, unregisterChangeProvider, unregisterListener
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FilesWatcher

public FilesWatcher(FilesWatcher.WatchedFilesProvider filesProvider)
Constructs files watcher from the specified watched files provider.

Parameters:
filesProvider - watched files provider
See Also:
FilesWatcher.WatchedFilesProvider
Method Detail

changesDetected

public boolean changesDetected()
Computes whether files state has been changed.

Specified by:
changesDetected in interface ChangeProvider
Returns:
true if files changes and false otherwise
See Also:
ChangeProvider.resetChanged()

getNewFiles

public java.util.List<java.io.File> getNewFiles()
Returns files detected as new

Returns:
new files

getRemovedFiles

public java.util.List<java.io.File> getRemovedFiles()
Returns files detected as removed

Returns:
removed files

getModifiedFiles

public java.util.List<java.io.File> getModifiedFiles()
Returns modified files

Returns:
modified files

resetChanged

public void resetChanged()
Takes current files state and remembers it.

Specified by:
resetChanged in interface ChangeProvider

getRequestor

public java.lang.String getRequestor()
Description copied from interface: ChangeProvider
Returns (short) string representation of this change source

Specified by:
getRequestor in interface ChangeProvider
Returns:
(short) string representation of this change source