Here you can find the source of writeFile(String filename, String content)
public static void writeFile(String filename, String content)
//package com.java2s; //License from project: Apache License import java.io.BufferedWriter; import java.io.FileWriter; import java.io.IOException; import java.io.Writer; public class Main { public static void writeFile(String filename, String content) { try {//from ww w .jav a 2 s .c om Writer wrtiter = new FileWriter(filename); ; BufferedWriter bufferedWriter = new BufferedWriter(wrtiter); bufferedWriter.write(content); bufferedWriter.close(); } catch (IOException e) { } } }