Here you can find the source of writefile(String m, String path)
public static void writefile(String m, String path)
//package com.java2s; //License from project: Open Source License import java.io.BufferedWriter; import java.io.File; import java.io.FileWriter; import java.io.IOException; public class Main { public static void writefile(String m, String path) { try {//w w w. j av a 2 s .c o m File file = new File(path); if (!file.exists()) { file.createNewFile(); } FileWriter fileWritter = new FileWriter(file.getName(), true); BufferedWriter bufferWritter = new BufferedWriter(fileWritter); bufferWritter.write(m); bufferWritter.close(); } catch (IOException e) { e.printStackTrace(); } } }