|
|
@ -1,8 +1,5 @@ |
|
|
|
package com.alibaba.excel.analysis; |
|
|
|
package com.alibaba.excel.analysis; |
|
|
|
|
|
|
|
|
|
|
|
import java.io.InputStream; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.alibaba.excel.analysis.csv.CsvExcelReadExecutor; |
|
|
|
import com.alibaba.excel.analysis.csv.CsvExcelReadExecutor; |
|
|
|
import com.alibaba.excel.analysis.v03.XlsSaxAnalyser; |
|
|
|
import com.alibaba.excel.analysis.v03.XlsSaxAnalyser; |
|
|
|
import com.alibaba.excel.analysis.v07.XlsxSaxAnalyser; |
|
|
|
import com.alibaba.excel.analysis.v07.XlsxSaxAnalyser; |
|
|
@ -26,7 +23,6 @@ import com.alibaba.excel.util.DateUtils; |
|
|
|
import com.alibaba.excel.util.FileUtils; |
|
|
|
import com.alibaba.excel.util.FileUtils; |
|
|
|
import com.alibaba.excel.util.NumberDataFormatterUtils; |
|
|
|
import com.alibaba.excel.util.NumberDataFormatterUtils; |
|
|
|
import com.alibaba.excel.util.StringUtils; |
|
|
|
import com.alibaba.excel.util.StringUtils; |
|
|
|
|
|
|
|
|
|
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
|
import org.apache.commons.collections4.CollectionUtils; |
|
|
|
import org.apache.poi.hssf.record.crypto.Biff8EncryptionKey; |
|
|
|
import org.apache.poi.hssf.record.crypto.Biff8EncryptionKey; |
|
|
|
import org.apache.poi.poifs.crypt.Decryptor; |
|
|
|
import org.apache.poi.poifs.crypt.Decryptor; |
|
|
@ -36,6 +32,9 @@ import org.apache.poi.util.IOUtils; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.Logger; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
import org.slf4j.LoggerFactory; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.io.InputStream; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @author jipengfei |
|
|
|
* @author jipengfei |
|
|
|
*/ |
|
|
|
*/ |
|
|
@ -177,7 +176,8 @@ public class ExcelAnalyserImpl implements ExcelAnalyser { |
|
|
|
// https://github.com/alibaba/easyexcel/issues/2309
|
|
|
|
// https://github.com/alibaba/easyexcel/issues/2309
|
|
|
|
try { |
|
|
|
try { |
|
|
|
if ((readWorkbookHolder instanceof CsvReadWorkbookHolder) |
|
|
|
if ((readWorkbookHolder instanceof CsvReadWorkbookHolder) |
|
|
|
&& ((CsvReadWorkbookHolder)readWorkbookHolder).getCsvParser() != null) { |
|
|
|
&& ((CsvReadWorkbookHolder) readWorkbookHolder).getCsvParser() != null |
|
|
|
|
|
|
|
&& analysisContext.readWorkbookHolder().getAutoCloseStream()) { |
|
|
|
((CsvReadWorkbookHolder) readWorkbookHolder).getCsvParser().close(); |
|
|
|
((CsvReadWorkbookHolder) readWorkbookHolder).getCsvParser().close(); |
|
|
|
} |
|
|
|
} |
|
|
|
} catch (Throwable t) { |
|
|
|
} catch (Throwable t) { |
|
|
|