文件写入

public class WriteFileUtil {
/**
* 向文件路径path写入内容context
* @param path 文件路径
* @param context 写入内容
*/
public static void write(String path,String context){
if(!FileUtil.exist(path)){
FileUtil.touch(path);
}
FileWriter write = new FileWriter(path);
write.append("\r");
write.append(context);
}
}

posted @ 2018-08-14 16:07  pretty flower  阅读(110)  评论(0编辑  收藏  举报