private static @Nullable VirtualFile getSelectedFile(@NotNull FileSystemTree fileSystemTree, @Nullable Project project) {
    VirtualFile file = getSelectedFile(project);
    return file != null && file.getParent() != null && fileSystemTree.isUnderRoots(file) ? file : null;
  }
private static @Nullable VirtualFile getSelectedFile(@NotNull FileSystemTree fileSystemTree, @Nullable Project project)