Ensure workbooks are closed after reading/writing
This commit is contained in:
parent
461b352035
commit
e2aa929908
@ -141,8 +141,8 @@ public class XlsExporter implements StreamExporter {
|
|||||||
project, engine, params, serializer);
|
project, engine, params, serializer);
|
||||||
|
|
||||||
wb.write(outputStream);
|
wb.write(outputStream);
|
||||||
wb.close();
|
|
||||||
outputStream.flush();
|
outputStream.flush();
|
||||||
|
wb.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -117,6 +117,7 @@ public class ExcelImporter extends TabularImportingParserBase {
|
|||||||
}
|
}
|
||||||
JSONUtilities.append(sheetRecords, sheetRecord);
|
JSONUtilities.append(sheetRecords, sheetRecord);
|
||||||
}
|
}
|
||||||
|
wb.close();
|
||||||
} finally {
|
} finally {
|
||||||
is.close();
|
is.close();
|
||||||
}
|
}
|
||||||
@ -146,7 +147,6 @@ public class ExcelImporter extends TabularImportingParserBase {
|
|||||||
Workbook wb = null;
|
Workbook wb = null;
|
||||||
if (!inputStream.markSupported()) {
|
if (!inputStream.markSupported()) {
|
||||||
inputStream = new BufferedInputStream(inputStream);
|
inputStream = new BufferedInputStream(inputStream);
|
||||||
;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
@ -222,6 +222,7 @@ public class ExcelImporterTests extends ImporterTest {
|
|||||||
wb.write(outputStream);
|
wb.write(outputStream);
|
||||||
outputStream.flush();
|
outputStream.flush();
|
||||||
outputStream.close();
|
outputStream.close();
|
||||||
|
wb.close();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user