|
|
@@ -793,11 +793,15 @@ public class GuoRenApiRequestImpl implements GuoRenApiRequest {
|
|
|
/**
|
|
|
* 工具方法:从文件名中提取后缀(如 "test.txt" → "txt")
|
|
|
*/
|
|
|
- private static String getFileSuffix(String fileName) {
|
|
|
- if (fileName == null || !fileName.contains(".")) {
|
|
|
- return "bin"; // 默认后缀(二进制文件)
|
|
|
+ private String getFileSuffix(String fileName) {
|
|
|
+ if (StringUtils.isEmpty(fileName)) {
|
|
|
+ return ".bin"; // 默认后缀
|
|
|
}
|
|
|
- return fileName.substring(fileName.lastIndexOf("."));
|
|
|
+ int lastIndexOf = fileName.lastIndexOf(".");
|
|
|
+ if (lastIndexOf == -1) {
|
|
|
+ return ".bin";
|
|
|
+ }
|
|
|
+ return fileName.substring(lastIndexOf);
|
|
|
}
|
|
|
|
|
|
|