Consistently open workbook in readonly mode

The itemreaders provided by this project are reading only. So it makes
sense to open them with only read-only priviliges. We already did this
for the streaming version of the itemreader. With this commit we also
enable this for the regular itemreader.

Closes: #128
This commit is contained in:
Marten Deinum
2024-08-07 13:04:42 +02:00
parent b3cbefb773
commit b6e2b97068

View File

@@ -81,7 +81,7 @@ public class PoiItemReader<T> extends AbstractExcelItemReader<T> {
protected void openExcelFile(final Resource resource, String password) throws Exception {
if (resource.isFile()) {
File file = resource.getFile();
this.workbook = WorkbookFactory.create(file, password, false);
this.workbook = WorkbookFactory.create(file, password, true);
}
else {
this.inputStream = resource.getInputStream();