java写入网页内容
public static boolean writeHtml(String htmlPath,String htmlContent) throws IOException { File newFile = new File(htmlPath); //自动创建目录 File parentPath = new File(newFile.getParent()); if(!parentPath.exists()) { parentPath.mkdirs(); } FileWriter fileWriterObj = new FileWriter(newFile); BufferedWriter bufferedWriterObj = new BufferedWriter(fileWriterObj); bufferedWriterObj.write(htmlContent+"\n"); bufferedWriterObj.flush(); bufferedWriterObj.close(); fileWriterObj.close(); return true; }
#########################
标签:bufferedWriterObj,java,写入,File,网页内容,new,newFile From: https://www.cnblogs.com/herd/p/16260624.html