/**
* 文件尾部追加内容
* @param filepath
* @param content
*/
public static void method1(String filepath , String content) {
FileWriter fw = null;
try {
//如果文件存在,则追加内容;如果文件不存在,则创建文件
File f=new File(filepath);
fw = new FileWriter(f, true);
} catch (IOException e) {
e.printStackTrace();
}
PrintWriter pw = new PrintWriter(fw);
pw.println(content);
pw.flush();
try {
fw.flush();
pw.close();
fw.close();
} catch (IOException e) {
e.printStackTrace();
}
}
因缺少博客内容,无法提炼关键信息生成摘要。
895

被折叠的 条评论
为什么被折叠?



