导入IO工具类
<dependencies>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.6</version>
</dependency>
</dependencies>
读取,写入文件
String result = FileUtils.readFileToString(new File(filePath), "utf-8");
FileUtils.writeStringToFile(new File(filePath), data, "utf-8");