Commit 28b50580 authored by neo's avatar neo

[bugfix] get file name ext for out of range exception

parent 83c19d89
......@@ -203,8 +203,7 @@ public class FinanceDataImportController {
private Boolean IsSameFileExtenstion(Map<String, MultipartFile> files) {
Set<String> extension = new HashSet<>();
for (MultipartFile file : files.values()) {
extension.add(file.getName().substring(file.getName().lastIndexOf(".") + 1, file.getName().length()
- file.getName().lastIndexOf(".")));
extension.add(file.getName().substring(file.getName().lastIndexOf(".") + 1, file.getName().length()));
}
if (extension.size() == 1) {
......@@ -216,8 +215,7 @@ public class FinanceDataImportController {
private String getExtension(Map<String, MultipartFile> files) {
MultipartFile file = files.values().stream().findFirst().get();
return file.getName().substring(file.getName().lastIndexOf(".") + 1, file.getName().length()
- file.getName().lastIndexOf("."));
return file.getName().substring(file.getName().lastIndexOf(".") + 1, file.getName().length());
}
private String SetUploadFolderPath(String importMethod, String fileExtension) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment