mirror of
https://github.com/jeecgboot/JeecgBoot.git
synced 2026-04-23 10:18:18 +00:00
Merge pull request #9548 from tejasae-afk/fix/close-inputstream-in-parse
Close InputStream in parse
This commit is contained in:
commit
d48507a7b6
@ -73,7 +73,7 @@ public class TikaDocumentParser {
|
||||
AssertUtils.assertNotEmpty("请选择文件", file);
|
||||
try {
|
||||
// 用于解析(使用FileInputStream避免file.toPath()在Linux非UTF-8环境下中文文件名报错)
|
||||
InputStream isForParsing = new FileInputStream(file);
|
||||
try (InputStream isForParsing = new FileInputStream(file)) {
|
||||
// 使用 Tika 自动检测 MIME 类型
|
||||
String fileName = file.getName().toLowerCase();
|
||||
//后缀
|
||||
@ -93,6 +93,7 @@ public class TikaDocumentParser {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* langchain4j 内部解析器
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user