private static WatchKey register(WatchService watchService, Path directory) throws IOException {
        return directory.register(watchService, StandardWatchEventKinds.ENTRY_CREATE, StandardWatchEventKinds.ENTRY_DELETE, StandardWatchEventKinds.ENTRY_MODIFY);
    }
Get a {@link WatchKey} from the given {@link WatchService} in the given {@link Path directory}.

@param watchService the watch service
@param directory the directory
@return the watch key
@throws IOException if unable to register
common/src/main/java/me/lucko/luckperms/common/storage/implementation/file/watcher/AbstractFileWatcher.java