private static @Nullable VirtualFile findFile(@NotNull String filePath, boolean refreshIfNeeded) {
    VirtualFileSystem fileSystem = StandardFileSystems.local();
    VirtualFile virtualFile = fileSystem.findFileByPath(filePath);
    if (refreshIfNeeded && (virtualFile == null || !virtualFile.isValid())) {
      virtualFile = fileSystem.refreshAndFindFileByPath(filePath);
    }
    return virtualFile;
  }
private static @Nullable VirtualFile findFile(@NotNull String filePath, boolean refreshIfNeeded)