Class FileWatcher
- java.lang.Object
-
- ghidra.framework.main.logviewer.ui.FileWatcher
-
public class FileWatcher extends java.lang.Object
The 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. TheWatchService
mechanism 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 void
start()
Starts polling, or resumes polling if previously stopped.void
stop()
Suspends the timer so it will no longer poll.
-
-
-
Constructor Detail
-
FileWatcher
public FileWatcher(java.io.File file, FVEventListener eventListener)
Constructor. Creates a newExecutor
that will inspect the file at regular intervals. Users must callstart()
to begin polling.- Parameters:
file
- the file to be watched
-
-