Here you can find the source of appendText(File f, String text)
public static void appendText(File f, String text)
//package com.java2s; //License from project: Open Source License import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; public class Main { public static void appendText(File f, String text) { try (FileWriter fw = new FileWriter(f, true); BufferedWriter bw = new BufferedWriter(fw); PrintWriter out = new PrintWriter(bw)) { out.println();//from w ww . j a v a 2 s .com out.print(text); } catch (IOException ex) { System.err.println(ex.getMessage()); } } }