Compare commits

...

1 Commits

Author SHA1 Message Date
vdrokov
ebadca0ed8 TESB-30552: org.apache.camel.component.file.GenericFileOnCompletion During Route Execution
Close workbook when finished writing excel file.
2020-10-05 20:42:27 +03:00

View File

@@ -308,6 +308,9 @@ public class ExcelTool {
if(outputStream != null) {
outputStream.close();
}
if (wb != null) {
wb.close();
}
}
}
@@ -319,14 +322,18 @@ public class ExcelTool {
pFile.mkdirs();
}
}
FileOutputStream fileOutput = new FileOutputStream(fileName);
if (appendWorkbook && appendSheet && recalculateFormula) {
evaluateFormulaCell();
}
FileOutputStream fileOutput = null;
try {
fileOutput = new FileOutputStream(fileName);
wb.write(fileOutput);
} finally {
fileOutput.close();
if (fileOutput != null)
fileOutput.close();
if (wb != null)
wb.close();
}
}