public @Nullable Path getOrCreateCommandHistoryFile(@Nullable String commandHistoryFileName, @NotNull Project project) {
    Path historyDir = getCommandHistoryDir();
    if (historyDir == null) {
      return null;
    }
    String projectPath = Objects.requireNonNull(project.getBasePath());
    if (commandHistoryFileName != null) {
      CommandHistoryFileInfo info = myMap.get(commandHistoryFileName);
      if (info != null && projectPath.equals(info.myProjectPath)) {
        Path path = historyDir.resolve(commandHistoryFileName);
        if (Files.exists(path)) {
          info.myAccessTime = now();
          return path;
        }
        myMap.remove(commandHistoryFileName);
      }
    }
    try {
      File tmpFile = FileUtil.createTempFile(historyDir.toFile(), project.getName() + "-history", null, true, false);
      Path filePath = tmpFile.toPath();
      String filename = getFilename(filePath);
      myMap.put(filename, createFileInfo(filename, projectPath));
      return filePath;
    }
    catch (IOException e) {
      LOG.info(e);
      return null;
    }
  }
public @Nullable Path getOrCreateCommandHistoryFile(@Nullable String commandHistoryFileName, @NotNull Project project)