//从string数组创建临时文件
private static File createSampleFile(String[] strs) throws IOException {
    File file = File.createTempFile("aws-java-sdk-", ".txt");
    file.deleteOnExit();
    Writer writer = new OutputStreamWriter(new FileOutputStream(file));
    for (String str : strs) {
        writer.write(str);
    }
    writer.close();
    return file;
}

 

相关文章:

  • 2021-12-25
  • 2021-11-30
  • 2021-12-01
  • 2022-12-23
  • 2022-12-23
  • 2021-12-15
  • 2021-12-10
  • 2022-01-11
猜你喜欢
  • 2022-12-23
  • 2022-01-28
  • 2021-06-03
  • 2021-10-21
  • 2021-11-29
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案