public static @NotNull File copyToTempFile(@NotNull @NlsSafe String path) throws CantRunException {
    VirtualFile virtualFile = findScriptFileByPath(path);
    if (virtualFile == null) {
      throw new CantRunException(ExecutionBundle.message("script.exception.file.not.found", path));
    }
    File ioFile;
    try {
      ioFile = FileUtil.createTempFile(virtualFile.getName(), "", true);
    }
    catch (IOException e) {
      throw new CantRunException(ExecutionBundle.message("script.exception.can.not.create.temp.file", virtualFile.getName()), e);
    }
    try {
      copyFile(virtualFile, ioFile);
      return ioFile;
    }
    catch (IOException e) {
      throw new CantRunException(
        ExecutionBundle.message("script.exception.can.not.write.temp.file", virtualFile.getPath(), ioFile.getAbsolutePath()), e);
    }
  }
public static @NotNull File copyToTempFile(@NotNull @NlsSafe String path)