code: private void checkAndProcessFileInfo(WatchKey key, List<FileInfo> fileInfos) {
          for (WatchEvent<?> event : key.pollEvents()) {
              WatchEvent.Kind kind = event.kind();
  
              for (FileInfo fileInfo : fileInfos) {
                  if (kind == OVERFLOW) {
                      try {
                          throw new IncompleteFileEventException();
                      } catch (IncompleteFileEventException e) {
                          log.warn(e);
                      }
                  } else if ((kind == ENTRY_CREATE || kind == ENTRY_MODIFY || kind == ENTRY_DELETE)
                          && isFileType(event, fileInfo.getFileType())) {
                      try {
                          if (fileInfo.getReloadableFile() != null) {
                              fileInfo.getReloadableFile().reloadFile(kind.toString());
                              debug("Reloaded file: " + event.context().toString());
                              getMain().getFilePublisher().notifyFileSubscribers(fileInfo.getReloadableFile());
                          }
                      } catch (Exception e) {
                          log.warn(e);
                      }
                      try {
                          Thread.sleep(1000);
                      } catch (InterruptedException e) {
                          log.warn(e);
                      }
                  }
              }
          }
      }
docs: Checks if {@code fileInfo} and {@code key} match each other, in which case the fileInfo and key are processed
  
  @param key current key
  @param fileInfos all fileInfos that match key