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

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

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

FileUtil.writeToTmpFile介绍

[英]Writes the given content to a file that is in the temporary directory returned by VulasConfiguration#getTmpDir().
[中]将给定内容写入VulasConfiguration#getTmpDir()返回的临时目录中的文件。

代码示例

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

public void setExcludePackages(String _packages) {

    // Overwrite configuration (if requested)
    if (_packages != null && !_packages.equals(""))
      VulasConfiguration.getGlobal().setProperty("vulas.reach.wala.callgraph.exclusions", _packages);

    // Get configuration (original or overwritten)
    final String buffer = VulasConfiguration.getGlobal().getConfiguration().getString("vulas.reach.wala.callgraph.exclusions");

    // Write exluded packages into file
    try {
      this.excludedPackagesFile = FileUtil.writeToTmpFile("exclusion", "txt", buffer.replaceAll(";", System.getProperty("line.separator"))).toFile();
    } catch (IOException e) {
      WalaCallgraphConstructor.log.error("Cannot create file with exlcuded Java packages: " + e.getMessage(), e);
    }

    WalaCallgraphConstructor.log.info("Set packages to be excluded [ " + buffer + " ]");
  }
}

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

try {
  _lib.getLibraryId().setAffLibraries(null);
  temp_file = FileUtil.writeToTmpFile("library", "json", JacksonUtil.asJsonString(_lib));
  log.info("To-be-saved library serialized to temporary JSON file [" + temp_file + "]");
} catch (Exception ioe) {

相关文章