Class SoFileSensor


public class SoFileSensor extends SoTimerSensor
Sensor that triggers a callback each time a file is changed. File sensors trigger their callback function when a watched file changes. Files are checked at the interval specified with SoTimerSensor.setInterval.

See Also:
  • Constructor Details

    • SoFileSensor

      public SoFileSensor()
      Default constructor.
  • Method Details

    • removeFile

      public void removeFile(String filename)
      Remove file from monitored list. If file is not being monitored, the method does nothing.
    • clearFiles

      public void clearFiles()
      Stop monitoring all previously registered files.
    • addFile

      public void addFile(String filename)
      Add file to be monitored. If file does not exist, the method does nothing.
    • getFilename

      public String getFilename()
      Return changed file name.
      Note: Only valid when called from the callback function.