!7 cmodule AutoRefreshCertificates > DynSingleFunction { transient FileWatchService watchService; start { ownResource(watchService = new FileWatchService); File dir = javaxSecretDir(); watchService.addRecursiveListener(dir, f -> enter { if (fileNameIs(f, "keystore.p12")) { print("Key store changed, reloading certificates: " + f); doIt(); } }); print("Watching " + dir + " for keystore changes"); } void doIt { call(mainMainClass(), 'serverSocketFactory_botCompanyEtc_update); print("Done!"); } }