Here you can find the source of writeStringToFile(String content, File file)
public static void writeStringToFile(String content, File file) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.File; import java.io.IOException; import java.io.PrintWriter; public class Main { public static void writeStringToFile(String content, File file) throws IOException { PrintWriter writer = new PrintWriter(file.getAbsolutePath(), "UTF-8"); writer.print(content);/*from w w w.j av a 2 s.com*/ writer.close(); } }