Here you can find the source of writeStringToFile(String str, String filePath)
public static void writeStringToFile(String str, String filePath)
//package com.java2s; //License from project: Open Source License import java.io.FileNotFoundException; import java.io.PrintWriter; public class Main { public static void writeStringToFile(String str, String filePath) { PrintWriter tmpASP;// w w w . ja va 2 s. c om try { tmpASP = new PrintWriter(filePath); tmpASP.print(str); tmpASP.close(); } catch (FileNotFoundException e) { e.printStackTrace(); } } }