Here you can find the source of appendLine(String path, String line)
public static void appendLine(String path, String line) throws UnsupportedEncodingException, FileNotFoundException
//package com.java2s; //License from project: Apache License import java.io.BufferedWriter; import java.io.File; import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStreamWriter; import java.io.UnsupportedEncodingException; import java.io.Writer; public class Main { public static void appendLine(String path, String line) throws UnsupportedEncodingException, FileNotFoundException { File file = new File(path); Writer writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(file, true), "UTF-8")); try {/*from w w w . j ava 2 s .c o m*/ writer.write(line + "\n"); writer.flush(); writer.close(); } catch (IOException e) { e.printStackTrace(); } } }