From dacbac0bf0bc08842a2b1e53634f57f7bf0bbaef Mon Sep 17 00:00:00 2001 From: fanwanlong Date: Fri, 4 Aug 2023 11:21:49 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8A=9B=E5=87=BA=E5=AF=B9=E5=BA=94=E7=9A=84?= =?UTF-8?q?=E7=A9=BA=E6=96=87=E4=BB=B6=E5=BC=82=E5=B8=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/java/com/alibaba/excel/support/ExcelTypeEnum.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/easyexcel-core/src/main/java/com/alibaba/excel/support/ExcelTypeEnum.java b/easyexcel-core/src/main/java/com/alibaba/excel/support/ExcelTypeEnum.java index e78bf94c..03cba5a1 100644 --- a/easyexcel-core/src/main/java/com/alibaba/excel/support/ExcelTypeEnum.java +++ b/easyexcel-core/src/main/java/com/alibaba/excel/support/ExcelTypeEnum.java @@ -11,6 +11,8 @@ import com.alibaba.excel.read.metadata.ReadWorkbook; import com.alibaba.excel.util.StringUtils; import lombok.Getter; + +import org.apache.poi.EmptyFileException; import org.apache.poi.util.IOUtils; /** @@ -87,6 +89,8 @@ public enum ExcelTypeEnum { return recognitionExcelType(inputStream); } catch (ExcelCommonException e) { throw e; + } catch (EmptyFileException e) { + throw new ExcelCommonException("The supplied file was empty (zero bytes long)"); } catch (Exception e) { throw new ExcelCommonException( "Convert excel format exception.You can try specifying the 'excelType' yourself", e);