MCPcopy Index your code
hub / github.com/Bit0r/java-util / writeToFileAppend

Method writeToFileAppend

src/main/java/util/AddTableField.java:99–118  ·  view source on GitHub ↗

追加文件

(String fileName, String text)

Source from the content-addressed store, hash-verified

97 * 追加文件
98 */
99 public static void writeToFileAppend(String fileName, String text) {
100 FileWriter fw = null;
101 try {
102 //如果文件存在,则追加内容;如果文件不存在,则创建文件
103 File f = new File(fileName);
104 fw = new FileWriter(f, false);
105 } catch (IOException e) {
106 e.printStackTrace();
107 }
108 PrintWriter pw = new PrintWriter(fw);
109 pw.println(text);
110 pw.flush();
111 try {
112 fw.flush();
113 pw.close();
114 fw.close();
115 } catch (IOException e) {
116 e.printStackTrace();
117 }
118 }
119
120 /**
121 * 修改实体类

Callers 1

upEntityClassMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected