Here you can find the source of appendLine(String filePath, String text)
public static void appendLine(String filePath, String text) throws Exception
//package com.java2s; //License from project: LGPL import java.io.File; import java.io.FileWriter; public class Main { public static void appendLine(String filePath, String text) throws Exception { File file = new File(filePath); FileWriter writer = new FileWriter(file, true); String lineSeparator = System.getProperty("line.separator"); if (!text.endsWith(lineSeparator)) { text += lineSeparator;/*from w w w .j av a 2 s . c o m*/ } writer.write(text); writer.close(); } }