Here you can find the source of appendStringToFile(File f, String s)
public static boolean appendStringToFile(File f, String s)
//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 boolean appendStringToFile(File f, String s) { try {/*from w w w .j av a 2s . c o m*/ PrintWriter out = new PrintWriter(new BufferedWriter(new FileWriter(f, true))); out.println(s); out.close(); return true; } catch (IOException e) { e.printStackTrace(); } return false; } }