@Override
    protected void processEvent(WatchEvent<Path> event, Path path) {
        // get the relative path of the event
        Path relativePath = this.basePath.relativize(path);
        if (relativePath.getNameCount() == 0) {
            return;
        }

        // pass the event onto all watched locations that match
        for (Map.Entry<Path, WatchedLocation> entry : this.watchedLocations.entrySet()) {
            if (relativePath.startsWith(entry.getKey())) {
                entry.getValue().onEvent(event, relativePath);
            }
        }
    }
Gets a {@link WatchedLocation} instance for a given path.

@param path the path to get a watcher for
@return the watched location
common/src/main/java/me/lucko/luckperms/common/storage/implementation/file/watcher/FileWatcher.java