Class ShadowFileObserver

java.lang.Object
org.robolectric.shadows.ShadowFileObserver

@Implements(android.os.FileObserver.class) public class ShadowFileObserver extends Object
A shadow implementation of FileObserver that uses java.nio.file.WatchService.

Currently only supports MODIFY, DELETE and CREATE (CREATE will encompass also events that would normally register as MOVED_FROM, and DELETE will encompass also events that would normally register as MOVED_TO). Other event types will be silently ignored.

  • Constructor Details

    • ShadowFileObserver

      public ShadowFileObserver()
  • Method Details

    • finalize

      @Implementation protected void finalize() throws Throwable
      Overrides:
      finalize in class Object
      Throws:
      Throwable
    • __constructor__

      @Implementation protected void __constructor__(String path, int mask)
    • __constructor__

      @Implementation(minSdk=29) protected void __constructor__(List<File> files, int mask)
    • startWatching

      @Implementation protected void startWatching() throws IOException
      Throws:
      IOException
    • stopWatching

      @Implementation protected void stopWatching()