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