Here you can find the source of writeFile(String content, String path)
public static void writeFile(String content, String path)
//package com.java2s; //License from project: Open Source License import java.io.*; public class Main { public static void writeFile(String content, String path) { File myFile = new File(path); try {/*from w w w . j av a 2s . c o m*/ myFile.createNewFile(); FileOutputStream fOut = new FileOutputStream(myFile); OutputStreamWriter myOutWriter = new OutputStreamWriter(fOut); myOutWriter.append(content); myOutWriter.close(); fOut.close(); } catch (IOException e) { e.printStackTrace(); } } }