This is my writeLog method.
Code:
public void writeLog(String data, String file) {
BufferedWriter bw = null;
try {
bw = new BufferedWriter(new FileWriter("../Data/" + file + ".txt", true));
bw.write(data);
bw.newLine();
bw.flush();
} catch (IOException ioe) {
ioe.printStackTrace();
} finally {
if (bw != null)
try {
bw.close();
} catch (IOException ioe2) {
printOut("Error writing system log.");
ioe2.printStackTrace();
}
}
}
Is there any way to make it erase what I type for data instead of writing it on the file?