Here you can find the source of saveFile(final File file, final String content)
public static void saveFile(final File file, final String content) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.*; public class Main { public static void saveFile(final File file, final String content) throws IOException { FileOutputStream fos = new FileOutputStream(file); final Writer writer = new OutputStreamWriter(fos, "UTF-8"); writer.write(content);// w ww .ja va2 s .c om writer.close(); fos.close(); } }