public static boolean contains(@NotNull Project project, @NotNull VirtualFile file) {
    RootType rootType = RootType.forFile(file);
    return rootType != null && !(rootType.isHidden() || rootType.isIgnored(project, file));
  }
public static boolean contains(@NotNull Project project, @NotNull VirtualFile file)