@RequestMapping("/read")
@ResponseBody
public String Read(String filePath ) throws Exception{
String bookContent = "";
File file = new File(filePath);
String code = null;
try {
code =getTxtCode(file);
}
Java获取TXT文本的内容
最新推荐文章于 2023-10-21 11:07:58 发布
本文介绍了如何使用Java编程语言从硬盘中读取TXT文本文件的内容,包括打开文件、逐行读取和关闭文件流的基本步骤,适用于后端开发者学习。
摘要由CSDN通过智能技术生成