com.sap.psr.vulas.shared.util.FileUtil.createTmpDir()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(2.8k)|赞(0)|评价(0)|浏览(170)

本文整理了Java中com.sap.psr.vulas.shared.util.FileUtil.createTmpDir()方法的一些代码示例,展示了FileUtil.createTmpDir()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。FileUtil.createTmpDir()方法的具体详情如下:
包路径:com.sap.psr.vulas.shared.util.FileUtil
类名称:FileUtil
方法名:createTmpDir

FileUtil.createTmpDir介绍

[英]Creates a new temporary directory with the given prefix inside the directory returned by #getVulasTmpDir().
[中]在#getvualstmpdir()返回的目录中创建一个具有给定前缀的新临时目录。

代码示例

代码示例来源:origin: SAP/vulnerability-assessment-tool

/**
 * Creates a new wrapper for the python executable at the given path.
 * @param _path_to_python
 */
public PyWrapper(Path _path_to_python, Path _log_dir) throws ProcessWrapperException {
  this.pathToPython = _path_to_python;
  if(_log_dir!=null)
    this.logDir = _log_dir;
  else {
    try {
      FileUtil.createTmpDir("vulas-pip-");
    } catch (IOException e) {
      throw new ProcessWrapperException("Cannot create tmp directory: " + e.getMessage());
    }
  }
}

代码示例来源:origin: SAP/vulnerability-assessment-tool

/**
 * Creates a new wrapper for the pip executable at the given path.
 * @param _path_to_pip
 */
public PipWrapper(Path _path_to_pip, Path _log_dir) throws ProcessWrapperException {
  this.pathToPip = _path_to_pip;
  if(_log_dir!=null)
    this.logDir = _log_dir;
  else {
    try {
      this.logDir = FileUtil.createTmpDir("vulas-pip-");
      log.info("Created tmp directory [" + this.logDir + "]");
    } catch (IOException e) {
      throw new ProcessWrapperException("Cannot create tmp directory: " + e.getMessage());
    }
  }
  // Not to be added as dependencies
  final String[] ignore_packs = VulasConfiguration.getGlobal().getStringArray(PythonConfiguration.PY_BOM_IGNORE_PACKS, new String[] {});
  this.ignorePacks.addAll(ignore_packs, true);
}

代码示例来源:origin: SAP/vulnerability-assessment-tool

this.pathToVirtualenv = FileUtil.createTmpDir("vulas-virtualenv-" + this.projectName + "-").toAbsolutePath();
} catch (IOException e) {
  throw new ProcessWrapperException("Cannot create tmp directory: " + e.getMessage());

代码示例来源:origin: SAP/vulnerability-assessment-tool

public PipInstalledPackage call() throws ProcessWrapperException, IOException {
    // Make download dir
    //final Path download_dir = Paths.get(logDir.toString(), "pip-download");
    final Path download_dir = FileUtil.createTmpDir(this.pack.getName() + "-");
    // Download all deps
    ProcessWrapper pw = new ProcessWrapper();
    pw.setCommand(pathToPip, "download", "-d", download_dir.toString(), "--no-cache-dir", this.pack.getName()+"=="+this.pack.getVersion());
    pw.setPath(logDir);
    pw.run();
    final Path download_info = pw.getOutFile();
    // Enrich with download info
    searchDownloadInfo(this.pack, FileUtil.readFile(download_info));
    return this.pack;
  }
}

代码示例来源:origin: SAP/vulnerability-assessment-tool

this.setTargetPath(FileUtil.createTmpDir("instr"));
log.warn("No target path specified, using [" + this.getTargetPath() + "]");

相关文章