Here you can find the source of writeStringToFile(String modifiedLine, String filePath)
public static void writeStringToFile(String modifiedLine, String filePath)
//package com.java2s; //License from project: Open Source License import java.io.BufferedWriter; import java.io.FileWriter; import java.io.IOException; public class Main { public static void writeStringToFile(String modifiedLine, String filePath) {/*from ww w . j a v a 2 s .c o m*/ BufferedWriter bw = null; try { bw = new BufferedWriter(new FileWriter(filePath, true)); bw.write(modifiedLine + "\n"); } catch (IOException e) { e.printStackTrace(); } finally { try { bw.flush(); bw.close(); } catch (IOException e) { e.printStackTrace(); } } } }