Aggiunto controllo estensione in lettura file excel
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package it.integry.ems_model.utility;
|
||||
|
||||
import it.integry.ems.Import.dto.ImportRequestDTO;
|
||||
import org.apache.commons.io.FilenameUtils;
|
||||
import org.apache.poi.hssf.usermodel.*;
|
||||
import org.apache.poi.hssf.util.HSSFCellUtil;
|
||||
import org.apache.poi.openxml4j.opc.OPCPackage;
|
||||
@@ -133,6 +134,9 @@ public class UtilityExcel {
|
||||
if (UtilityString.isNullOrEmpty(fileName))
|
||||
fileName = requestDTO.getFileName();
|
||||
|
||||
if (!FilenameUtils.getExtension(fileName).equalsIgnoreCase("xlsx"))
|
||||
throw new Exception("Formato file non supportato");
|
||||
|
||||
if (!path.endsWith("\\") || !path.endsWith("/"))
|
||||
path = path + File.separator;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user