Skip to content

Instantly share code, notes, and snippets.

@RammusXu
Created November 8, 2014 07:09
Show Gist options
  • Save RammusXu/b24e25ef9bbf84bbc644 to your computer and use it in GitHub Desktop.
Save RammusXu/b24e25ef9bbf84bbc644 to your computer and use it in GitHub Desktop.
public void writeFile(String dir, String filename, String string) {
FileWriter fw;
try {
File f = new File(dir, filename);
if (!f.exists()) {
f.createNewFile();
}
fw = new FileWriter(f, true);
fw.append(string);
fw.close();
} catch (IOException e) {
e.printStackTrace();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment