Here you can find the source of writeFile(File file, String content)
public static void writeFile(File file, String content) throws IOException
//package com.java2s; //License from project: Apache License import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; public class Main { public static void writeFile(File file, String content) throws IOException { writeFile(file, content, false); }/*from w w w . ja va2 s . co m*/ public static void writeFile(File file, String content, boolean append) throws IOException { BufferedWriter writer = new BufferedWriter(new FileWriter(file, append)); writer.write(content); writer.close(); } }