Here you can find the source of saveStringAsFile(String string, String path)
public static boolean saveStringAsFile(String string, String path)
//package com.java2s; //License from project: Open Source License import java.io.FileNotFoundException; import java.io.PrintWriter; public class Main { public static boolean saveStringAsFile(String string, String path) { PrintWriter out;//w ww . jav a 2 s .com try { out = new PrintWriter(path); out.println(string); out.close(); } catch (FileNotFoundException e) { e.printStackTrace(); return false; } return true; } }