protected void initializeWatchService(final Path watchablePath) {
        this.watchService = FunctionUtils.doUnchecked(() -> watchablePath.getFileSystem().newWatchService());
        LOGGER.trace("Created watcher for events of type [{}]", Arrays.stream(KINDS)
            .map(WatchEvent.Kind::name)
            .collect(Collectors.joining(",")));
        FunctionUtils.doUnchecked(__ -> watchablePath.register(Objects.requireNonNull(this.watchService), KINDS));
    }
Control watch operations on paths and files as a service.

@author David Rodriguez
@since 5.2.0
core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/io/PathWatcherService.java