Here you can find the source of writeFile(File f, String content)
private static File writeFile(File f, String content) throws IOException
//package com.java2s; //License from project: Apache License import java.io.FileOutputStream; import java.io.IOException; import java.io.File; public class Main { private static File writeFile(File f, String content) throws IOException { FileOutputStream fsout = new FileOutputStream(f); fsout.write(content.toString().getBytes()); fsout.close();// ww w .j a v a2 s . co m return f; } }