mirror of
https://github.com/jeecgboot/JeecgBoot.git
synced 2026-04-25 03:08:11 +00:00
Close InputStream in parse
This commit is contained in:
parent
cf7eeac6ab
commit
f8791bb885
@ -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