String fileName = "filename.html";StringBuilder sb = new StringBuilder();// 使用StringBuilder 构建HTML文件sb.append("<html>\n");sb.append("<head>\n");sb.append("<title>HTML File</title>\n");sb.append("</head>\n");sb.append("<body>\n");sb.append("<p>Hello World!</p>\n");sb.append("</body>\n");sb.append("</html>\n");// 将html文件写入磁盘指定位置FileWriter fw = null;try {fw = new FileWriter("/home/project/taotao/html/ssd/" + fileName);fw.write(sb.toString());} catch (IOException e) {e.printStackTrace();} finally {if (fw != null) {try {fw.close();} catch (IOException e) {e.printStackTrace();}}}