private static Map<String, FileAttributes> listWithAttributes(VirtualFile dir, @Nullable Set<String> filter) {
    try {
      var list = CollectionFactory.<FileAttributes>createFilePathMap(10, dir.isCaseSensitive());

      PlatformNioHelper.visitDirectory(Path.of(toIoPath(dir)), filter, (file, result) -> {
        try {
          var attributes = amendAttributes(file, FileAttributes.fromNio(file, result.get()));
          list.put(file.getFileName().toString(), attributes);
        }
        catch (Exception e) { LOG.debug(e); }
        return true;
      });

      return list;
    }
    catch (AccessDeniedException | NoSuchFileException e) { LOG.debug(e); }
    catch (IOException | RuntimeException e) { LOG.warn(e); }
    return Map.of();
  }
private static Map<String, FileAttributes> listWithAttributes(VirtualFile dir, @Nullable Set<String> filter)