Here you can find the source of appendFile(File f, String content)
public static void appendFile(File f, String content) throws Exception
//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 appendFile(File f, String content) throws Exception { BufferedWriter writer = null; try {/*from w w w . j a v a 2 s . co m*/ writer = new BufferedWriter(new FileWriter(f, true)); writer.write(content); } catch (Exception e) { throw e; } finally { if (writer != null) { try { writer.flush(); writer.close(); } catch (IOException e) { e.printStackTrace(); } } } } }