|
|
|
@ -117,30 +117,30 @@ public class ExcelAnalyserImpl implements ExcelAnalyser {
|
|
|
|
|
throw new ExcelAnalysisException("Can not close IO", e); |
|
|
|
|
} |
|
|
|
|
try { |
|
|
|
|
if (analysisContext.readWorkbookHolder().getAutoCloseStream() |
|
|
|
|
&& readWorkbookHolder.getInputStream() != null) { |
|
|
|
|
readWorkbookHolder.getInputStream().close(); |
|
|
|
|
if (readWorkbookHolder.getOpcPackage() != null) { |
|
|
|
|
readWorkbookHolder.getOpcPackage().close(); |
|
|
|
|
} |
|
|
|
|
} catch (Throwable e) { |
|
|
|
|
throw new ExcelAnalysisException("Can not close IO", e); |
|
|
|
|
} |
|
|
|
|
try { |
|
|
|
|
if (readWorkbookHolder.getTempFile() != null) { |
|
|
|
|
FileUtils.delete(readWorkbookHolder.getTempFile()); |
|
|
|
|
if (readWorkbookHolder.getPoifsFileSystem() != null) { |
|
|
|
|
readWorkbookHolder.getPoifsFileSystem().close(); |
|
|
|
|
} |
|
|
|
|
} catch (Throwable e) { |
|
|
|
|
throw new ExcelAnalysisException("Can not close IO", e); |
|
|
|
|
} |
|
|
|
|
try { |
|
|
|
|
if (readWorkbookHolder.getOpcPackage() != null) { |
|
|
|
|
readWorkbookHolder.getOpcPackage().close(); |
|
|
|
|
if (analysisContext.readWorkbookHolder().getAutoCloseStream() |
|
|
|
|
&& readWorkbookHolder.getInputStream() != null) { |
|
|
|
|
readWorkbookHolder.getInputStream().close(); |
|
|
|
|
} |
|
|
|
|
} catch (Throwable e) { |
|
|
|
|
throw new ExcelAnalysisException("Can not close IO", e); |
|
|
|
|
} |
|
|
|
|
try { |
|
|
|
|
if (readWorkbookHolder.getPoifsFileSystem() != null) { |
|
|
|
|
readWorkbookHolder.getPoifsFileSystem().close(); |
|
|
|
|
if (readWorkbookHolder.getTempFile() != null) { |
|
|
|
|
FileUtils.delete(readWorkbookHolder.getTempFile()); |
|
|
|
|
} |
|
|
|
|
} catch (Throwable e) { |
|
|
|
|
throw new ExcelAnalysisException("Can not close IO", e); |
|
|
|
|