Class DirectoryTrigger

java.lang.Object
com.arpnetworking.configuration.triggers.DirectoryTrigger
All Implemented Interfaces:
Trigger

public final class DirectoryTrigger extends Object implements Trigger
${link Trigger} implementation based on the contents of a directory. Configurable to either monitor all content or only specific content. The ${link FileTrigger} is used to determine whether a file changed. This is intended to monitor the files in a single directory and is not designed to monitor a directory tree (e.g. it is not recursive). Note: If you are monitoring a directory in which files are created and removed this implementation needs to be modified to purge file trigger instances when a file is removed!
Author:
Ville Koskela (ville dot koskela at inscopemetrics dot io)
  • Method Details

    • evaluateAndReset

      public boolean evaluateAndReset()
      Description copied from interface: Trigger
      Evaluate the trigger. True indicates the trigger has been tripped. Evaluating the trigger will reset its state and the trigger will not return true again until it is tripped again.
      Specified by:
      evaluateAndReset in interface Trigger
      Returns:
      True if and only if the trigger has been tripped.
    • toLogValue

      public Object toLogValue()
      Generate a Steno log compatible representation.
      Returns:
      Steno log compatible representation.
    • toString

      public String toString()
      Overrides:
      toString in class Object