Here you can find the source of writeStringToFile(final String text, final File filePath)
public static void writeStringToFile(final String text, final File filePath) throws java.io.IOException
//package com.java2s; //License from project: Apache License import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; public class Main { public static void writeStringToFile(final String text, final File filePath) throws java.io.IOException { final BufferedWriter out = new BufferedWriter(new FileWriter(filePath)); out.write(text);//w ww . ja va2s.c om out.close(); } }