Here you can find the source of writeFile(String filePath, String fileContent)
public static boolean writeFile(String filePath, String fileContent)
//package com.java2s; //License from project: Apache License import java.io.FileWriter; import java.io.IOException; import java.io.PrintWriter; public class Main { public static boolean writeFile(String filePath, String fileContent) { FileWriter fw = null;//ww w.ja va2s.c o m try { fw = new FileWriter(filePath, true); PrintWriter pw = new PrintWriter(fw); pw.print(fileContent); pw.close(); fw.close(); return true; } catch (IOException e) { } return false; } }