Here you can find the source of saveFile(String path, String text)
public static void saveFile(String path, String text) throws IOException
//package com.java2s; //License from project: Open Source License import java.io.FileNotFoundException; import java.io.IOException; import java.io.PrintWriter; public class Main { public static void saveFile(String path, String text) throws IOException { PrintWriter out;/* w ww . j a v a 2 s. com*/ try { out = new PrintWriter(path); out.print(text); out.close(); } catch (FileNotFoundException e) { throw e; } } }