Here you can find the source of writeStringTo(String _value, File _target)
public static void writeStringTo(String _value, File _target) throws IOException
//package com.java2s; import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; public class Main { public static void writeStringTo(String _value, File _target) throws IOException { BufferedWriter writer = new BufferedWriter(new FileWriter(_target)); try {/* ww w . ja v a 2s.c o m*/ if (null != _value) writer.write(_value); } finally { writer.close(); } } }