All pastes #478740 Raw Edit

Anonymous

public text v1 · immutable
·published 2007-05-09 10:49 UTC
rendered paste body
  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);
    }
  }