Here you can find the source of saveAllToFile(String filename, String... strings)
public static boolean saveAllToFile(String filename, String... strings)
//package com.java2s; //License from project: LGPL import java.io.File; import java.io.FileWriter; import java.io.IOException; public class Main { public static boolean saveAllToFile(String filename, String... strings) { return saveAllToFile(new File(filename), strings); }//from ww w .j a v a 2 s.c om public static boolean saveAllToFile(File file, String... strings) { try { FileWriter fw = new FileWriter(file); for (String s : strings) { fw.write(s); } fw.flush(); fw.close(); return true; } catch (IOException e) { e.printStackTrace(); System.out.println("Saving to file " + file.getName() + " failed! Aborting shut down..."); return false; } } }