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