private static CheckedConsumer<File> getWatchedFileConsumer(
        final File watchableFile, final CheckedConsumer<File> consumer) {
        return file -> {
            if (file.getPath().equals(watchableFile.getPath())) {
                LOGGER.trace("Detected change in file [{}] and calling change consumer to handle event", file);
                CheckedConsumer.sneaky(consumer).accept(file);
            }
        };
    }
This is {@link FileWatcherService}.

@author Misagh Moayyed
@since 5.2.0
core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/io/FileWatcherService.java