Here you can find the source of appendFile(String path, String content)
public static void appendFile(String path, String content) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.File; import java.io.FileOutputStream; import java.io.IOException; public class Main { public static void appendFile(String path, String content) throws IOException { File file = new File(path); if (!file.exists()) { file.createNewFile();//from w w w . j a v a 2 s . c om } FileOutputStream outputStream = new FileOutputStream(file, true); outputStream.write(content.getBytes("utf-8")); outputStream.close(); } }