Here you can find the source of writeFile(ArrayList
public static void writeFile(ArrayList<String> lines, String dest_path)
//package com.java2s; //License from project: Open Source License import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.util.ArrayList; public class Main { public static void writeFile(ArrayList<String> lines, String dest_path) { FileWriter writer;/* w w w . j a va2s. c o m*/ try { writer = new FileWriter(dest_path); for (String str : lines) { writer.write(str); } writer.close(); } catch (IOException e) { System.out.println("ERROR: FileUtils: writeFile: Error in the I/O! exception was: " + e.toString()); } File dest = new File(dest_path); dest.setExecutable(true); } }