Here you can find the source of writeFile(String filePath, String content)
public static void writeFile(String filePath, String content) throws Exception
//package com.java2s; import java.io.*; public class Main { public static void writeFile(String filePath, String content) throws Exception { FileOutputStream outSTr = new FileOutputStream(new File(filePath)); BufferedOutputStream Buff = new BufferedOutputStream(outSTr); Buff.write(content.getBytes());/*from w w w.j av a 2s .c o m*/ Buff.flush(); Buff.close(); } }