Class FileWatcher
- java.lang.Object
-
- ghidra.framework.main.logviewer.ui.FileWatcher
-
public class FileWatcher extends java.lang.ObjectThe FileWatcher *watches* a single file and fires a change notification whenever the file is modified. A couple notes: 1. To keep from processing change events every time the file is modified, which may be too frequent and cause processing issues, we use a simple polling mechanism. 2. Changes in the file are identified by inspecting theFile.lastModified()timestamp. 3. TheWatchServicemechanism is not being used here since we cannot specify a polling rate.
-
-
Constructor Summary
Constructors Constructor Description FileWatcher(java.io.File file, FVEventListener eventListener)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidstart()Starts polling, or resumes polling if previously stopped.voidstop()Suspends the timer so it will no longer poll.
-
-
-
Constructor Detail
-
FileWatcher
public FileWatcher(java.io.File file, FVEventListener eventListener)Constructor. Creates a newExecutorthat will inspect the file at regular intervals. Users must callstart()to begin polling.- Parameters:
file- the file to be watched
-
-