/**
* 生成TXT文件
* @param fileName 文件路径+文件名
* @param append 是否是追加内容
* @param encoding 编码格式
* @param data 生成内容
* @throws Exception
*/
public void writeFile(String path,String fileName,boolean append,String encoding,String data) throws Exception {
File newfilePath = new File(path);
if (!newfilePath.exists()) {
newfilePath.mkdirs();
}
BufferedWriter out = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(new File(path+fileName),append),encoding));
out.write(data);
out.close();
}
05-11