I am using a slightly modified version from this post
The watch service worked perfectly for a couple of months but now it doesn't see any changes to my directory. I have it setup to run on gateway start. I checked to make sure the directory files are reachable, by using system.file.readFileAsString from the gateway and works fine. If I start a watch service on my local machine in the script console it works as expected on a local test folder. Any ideas on what the problem could be? I've stopped and started the service, the gateway, and rebooted...no changes.
Might be a JDK bug; eg: https://bugs.openjdk.java.net/browse/JDK-7158947
If it only affects the gateway, you can try updating the runtime on the gateway to the latest Java 8 release, but there's no guarantee it will be fixed.
So weird. I updated to latest version of Java 8. If I invoke the file watcher on the gateway machine in a designer/client it works. If I invoke it on the same machine but in the gateway, it doesn’t work. In case I didn’t mention it, I’m watching a shared drive I connected to Ignition via the Ignition.conf file.
EDIT
I deleted my mapped drive in the config file \\L: and renamed it to \\K: then stopped and started the gateway and I can still read files from the L drive? How is it still connected?