Anonymous
public text v1 · immutable public void saveFile(String text, String file, boolean ai) {
try {
boolean created = new File("orders").mkdir();
if(created) System.out.println("You didnt have orders directory, creating it!");
File f = new File(file);
FileWriter fw = new FileWriter (f,ai);
PrintWriter pw = new PrintWriter (fw);
pw.write(text);
pw.flush();
pw.close();
} catch(java.io.IOException e) {
System.out.println("There was problems while saving "+file);
}
}