mirror of
https://gitee.com/chinabugotech/hutool.git
synced 2025-04-19 03:01:48 +08:00
Fix (hutool-core): 修复后缀为 apk 的文件被识别成 jar 或 zip 的问题
# 修改 1. 由于 apk 本质就是 zip 文件,同时 jar 和 zip 文件的头类似,会存在被识别成 jar 或者 zip 的情况,因此增加补充判断避免将 apk 返回为 zip 或者 jar
This commit is contained in:
parent
65ccea7940
commit
8e51df4f2b
@ -182,6 +182,8 @@ public class FileTypeUtil {
|
||||
typeName = "war";
|
||||
} else if ("ofd".equalsIgnoreCase(extName)) {
|
||||
typeName = "ofd";
|
||||
} else if ("apk".equalsIgnoreCase(extName)) {
|
||||
typeName = "apk";
|
||||
}
|
||||
} else if ("jar".equals(typeName)) {
|
||||
// wps编辑过的.xlsx文件与.jar的开头相同,通过扩展名判断
|
||||
@ -196,6 +198,8 @@ public class FileTypeUtil {
|
||||
typeName = "pptx";
|
||||
} else if ("zip".equalsIgnoreCase(extName)) {
|
||||
typeName = "zip";
|
||||
} else if ("apk".equalsIgnoreCase(extName)) {
|
||||
typeName = "apk";
|
||||
}
|
||||
}
|
||||
return typeName;
|
||||
|
Loading…
x
Reference in New Issue
Block a user