Here you can find the source of FileAppend(String fileNameWithPath, String content)
public static boolean FileAppend(String fileNameWithPath, String content) throws Exception
//package com.java2s; //License from project: Open Source License import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; public class Main { public static boolean FileAppend(String fileNameWithPath, String content) throws Exception { File file = new File(fileNameWithPath); // if file doesnt exists, then create it if (!file.exists()) { file.createNewFile();//from w ww .j a v a 2s . c om } FileWriter fw = new FileWriter(file.getAbsoluteFile(), true); BufferedWriter bw = new BufferedWriter(fw); bw.append(content); bw.close(); return true; } }