生成html(2)


import java.io.File;

import java.io.FileWriter;
import java.io.IOException;
import java.io.StringWriter;


public class PublishFileWriter {

	/**
	 * 写文件到磁盘 realpath 生成文件的位置  fileName 生成文件的文件名
	 * 
	 * @param articlecolumn
	 * @param fileContent
	 * @throws IOException
	 * @preserve
	 */
	public void writeFile( StringWriter fileContent,String realpath ,String fileName)
			throws IOException {
		File file;
		FileWriter fw;
	
		String content = fileContent.toString();
		
		file = new File(realpath + "/" + fileName);
		fw = new FileWriter(file);
		fw.write(content);
		fileContent.close();
		fw.close();
	}
	
	

}

你可能感兴趣的:(java,html)