Update to using latest version of POI

This commit is contained in:
Owen Stephens 2019-04-09 12:55:23 +01:00
parent 7099ec3a35
commit 6e26162619
3 changed files with 7 additions and 6 deletions

View File

@ -348,12 +348,12 @@
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi</artifactId>
<version>4.0.1</version>
<version>4.1.0</version>
</dependency>
<dependency>
<groupId>org.apache.poi</groupId>
<artifactId>poi-ooxml</artifactId>
<version>3.8</version> <!-- in classpath: 3.13-20150929 -->
<version>4.1.0</version> <!-- in classpath: 3.13-20150929 -->
</dependency>
<dependency>
<groupId>org.apache.odftoolkit</groupId>

View File

@ -141,6 +141,7 @@ public class XlsExporter implements StreamExporter {
project, engine, params, serializer);
wb.write(outputStream);
wb.close();
outputStream.flush();
}

View File

@ -44,8 +44,8 @@ import java.util.HashMap;
import java.util.List;
import java.util.Map;
import org.apache.poi.POIXMLDocument;
import org.apache.poi.POIXMLException;
import org.apache.poi.ooxml.POIXMLDocument;
import org.apache.poi.ooxml.POIXMLException;
import org.apache.poi.common.usermodel.Hyperlink;
import org.apache.poi.hssf.usermodel.HSSFDateUtil;
import org.apache.poi.hssf.usermodel.HSSFWorkbook;
@ -95,7 +95,7 @@ public class ExcelImporter extends TabularImportingParserBase {
}
try {
Workbook wb = POIXMLDocument.hasOOXMLHeader(is) ?
Workbook wb = FileMagic.valueOf(is) == FileMagic.OOXML ?
new XSSFWorkbook(is) :
new HSSFWorkbook(new POIFSFileSystem(is));
@ -147,7 +147,7 @@ public class ExcelImporter extends TabularImportingParserBase {
}
try {
wb = POIXMLDocument.hasOOXMLHeader(inputStream) ?
wb = FileMagic.valueOf(InputStream) == FileMagic.OOXML ?
new XSSFWorkbook(inputStream) :
new HSSFWorkbook(new POIFSFileSystem(inputStream));
} catch (IOException e) {