/** * */ package com.ape.weibo.basedata.utils; import java.io.BufferedWriter; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStreamWriter; /** * @author Happy * @me <a href="http://www.weibo.com/qiaolevip">@快乐每一天Joe</a> * @mail qiaole1990@sina.com * @date 2012-1-31 */ public class OperaFile { public void writeFile(String content) { try { BufferedWriter out = new BufferedWriter(new OutputStreamWriter( new FileOutputStream("./src/main/config/weibo_url.txt"), "UTF-8")); out.write(content); out.newLine(); out.flush(); out.close(); } catch (IOException e) { e.printStackTrace(); } } public static void main(String[] args) { OperaFile operaFile = new OperaFile(); operaFile.writeFile("jjjjjjjjjjjjjjj\r\neeeeeeee"); } }