Here you can find the source of appendFile(String file, String content)
public static void appendFile(String file, String content)
//package com.java2s; //License from project: Open Source License import java.io.BufferedWriter; import java.io.FileWriter; import java.io.PrintWriter; public class Main { /**//ww w. j ava2s . c o m * Append 'content' in 'dir'/'file' */ public static void appendFile(String file, String content) { try (PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(file, true)))) { out.println(content); out.close(); } catch (Exception e) { e.printStackTrace(); } } }