处理文件后缀大小写区分问题
This commit is contained in:
parent
3abec0a326
commit
c104c3a589
@ -405,7 +405,7 @@ public class FileServiceImpl extends AbstractService implements IFileService {
|
|||||||
*/
|
*/
|
||||||
private boolean isTypeCorrect(String[] types, String fileType) {
|
private boolean isTypeCorrect(String[] types, String fileType) {
|
||||||
for (String type : types) {
|
for (String type : types) {
|
||||||
if (fileType.equals(type)) {
|
if (StringUtils.equalsIgnoreCase(fileType, type)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -421,7 +421,7 @@ public class FileServiceImpl extends AbstractService implements IFileService {
|
|||||||
private String getFileType(String fileName) {
|
private String getFileType(String fileName) {
|
||||||
String[] names = fileName.split("\\.");
|
String[] names = fileName.split("\\.");
|
||||||
if (names != null) {
|
if (names != null) {
|
||||||
return names[names.length - 1];
|
return names[names.length - 1].toLowerCase();
|
||||||
}
|
}
|
||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
@ -128,10 +128,6 @@
|
|||||||
<groupId>javax.validation</groupId>
|
<groupId>javax.validation</groupId>
|
||||||
<artifactId>validation-api</artifactId>
|
<artifactId>validation-api</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.hibernate</groupId>
|
|
||||||
<artifactId>hibernate-validator</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<!-- validation end -->
|
<!-- validation end -->
|
||||||
<!-- dom4j start -->
|
<!-- dom4j start -->
|
||||||
<dependency>
|
<dependency>
|
||||||
|
6
pom.xml
6
pom.xml
@ -52,7 +52,6 @@
|
|||||||
<shiro.version>1.4.0</shiro.version>
|
<shiro.version>1.4.0</shiro.version>
|
||||||
<poi.version>3.17</poi.version>
|
<poi.version>3.17</poi.version>
|
||||||
<validation.version>2.0.1.Final</validation.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>
|
<dom4j.version>1.6.1</dom4j.version>
|
||||||
<quartz.version>2.3.0</quartz.version>
|
<quartz.version>2.3.0</quartz.version>
|
||||||
<ehcache.version>2.10.4</ehcache.version>
|
<ehcache.version>2.10.4</ehcache.version>
|
||||||
@ -202,11 +201,6 @@
|
|||||||
<artifactId>validation-api</artifactId>
|
<artifactId>validation-api</artifactId>
|
||||||
<version>${validation.version}</version>
|
<version>${validation.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>org.hibernate</groupId>
|
|
||||||
<artifactId>hibernate-validator</artifactId>
|
|
||||||
<version>${hibernate-validation.version}</version>
|
|
||||||
</dependency>
|
|
||||||
<!-- validation end -->
|
<!-- validation end -->
|
||||||
<!-- dom4j start -->
|
<!-- dom4j start -->
|
||||||
<dependency>
|
<dependency>
|
||||||
|
Loading…
Reference in New Issue
Block a user