处理文件后缀大小写区分问题

This commit is contained in:
wenc000 2020-05-31 11:18:06 +08:00
parent 3abec0a326
commit c104c3a589
3 changed files with 2 additions and 12 deletions

View File

@ -405,7 +405,7 @@ public class FileServiceImpl extends AbstractService implements IFileService {
*/
private boolean isTypeCorrect(String[] types, String fileType) {
for (String type : types) {
if (fileType.equals(type)) {
if (StringUtils.equalsIgnoreCase(fileType, type)) {
return true;
}
}
@ -421,7 +421,7 @@ public class FileServiceImpl extends AbstractService implements IFileService {
private String getFileType(String fileName) {
String[] names = fileName.split("\\.");
if (names != null) {
return names[names.length - 1];
return names[names.length - 1].toLowerCase();
}
return "";
}

View File

@ -128,10 +128,6 @@
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
</dependency>
<!-- validation end -->
<!-- dom4j start -->
<dependency>

View File

@ -52,7 +52,6 @@
<shiro.version>1.4.0</shiro.version>
<poi.version>3.17</poi.version>
<validation.version>2.0.1.Final</validation.version>
<hibernate-validation.version>6.0.17.Final</hibernate-validation.version>
<dom4j.version>1.6.1</dom4j.version>
<quartz.version>2.3.0</quartz.version>
<ehcache.version>2.10.4</ehcache.version>
@ -202,11 +201,6 @@
<artifactId>validation-api</artifactId>
<version>${validation.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-validator</artifactId>
<version>${hibernate-validation.version}</version>
</dependency>
<!-- validation end -->
<!-- dom4j start -->
<dependency>