Here you can find the source of writeStringToFile(String content, File targetFile)
public static void writeStringToFile(String content, File targetFile) throws Exception
//package com.java2s; //License from project: Apache License import java.io.File; import java.io.FileWriter; public class Main { public static void writeStringToFile(String content, File targetFile) throws Exception { FileWriter writer = new FileWriter(targetFile); writer.write(content);/*ww w. j a v a 2 s . co m*/ writer.flush(); writer.close(); } }