java 写入网页内容
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; }
#########################
QQ 3087438119