FileUtils

Last modified date

Comments: 0

Description:

A Java tool Lib for easily operating files.

// Append file / Overrite file if last params is false
FileUtils.writeStringToFile(new File(<path>), <data>, "UTF-8",true);
FileUtils.write(new File(<path>), <data>, "UTF-8",true);
FileUtils.writeLines(new File(<path>),<dataList>,true);
// Read File to a Sting
FileUtils.readFileToString(new File(<path>), "UTF-8"))
// Read File to a List
FileUtils.readLines(new File(<path>), "UTF-8")

Other File IO methods:

BufferedReader reader = new BufferedReader(new FileReader(<path>));
<Class> obj = gson.fromJson(reader, <Class>.class);

Reference:

https://blog.csdn.net/Dream_Weave/article/details/84988332

jimschenchen

即使苍天陨落,契约必须完成

Share

Leave a Reply