Skip to content

Instantly share code, notes, and snippets.

@seunggabi
Last active November 9, 2019 12:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save seunggabi/d85e9f856315a6974a7e96d096e3b0bd to your computer and use it in GitHub Desktop.
Save seunggabi/d85e9f856315a6974a7e96d096e3b0bd to your computer and use it in GitHub Desktop.
makeFile.java
private static File makeFile(List<String> lines) throws IOException {
File temp = File.createTempFile(FILENAME, "");
BufferedWriter bw = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(temp, true), StandardCharsets.UTF_8));
for(String line : lines) {
bw.write(line + "\n");
}
bw.close();
return temp;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment