/**
*
* @param filePath 路径
* @param content 内容
* @param append 是否在原内容追加
*/
public static void WriteToFile(String filePath, String content, boolean append) {
FileWriter fileWriter;
try {
fileWriter = new FileWriter(filePath, append);
fileWriter.write(content);
fileWriter.flush();
fileWriter.close();
} catch (IOException e) {
log.error("写入文件错误");
}
}
IO追加文件内容工具类
最新推荐文章于 2024-07-22 14:15:06 发布