I am using Jnotify to write an app. (JNotify is a library for for detecting file modification.)
The app has the following components:
A file writer that writes to file X
A file watcher (created using JNotify) that watches file X
An external app (such as notepad) that writes to file X as demanded by user.
I want JNotify to trigger notifications only when X is modified using 3, and to ignore when modified via 1. (or at least differentiate between modifications via 1 and 3).
Is there a simple way in which I can do it? One way is to have a synchronized variable that is toggled when the file writer writes to it, but I feel this is not very elegant.