public class XSSFWorkbookFactory extends WorkbookFactory
WorkbookFactory.CreateWorkbook0, WorkbookFactory.CreateWorkbook1<T>, WorkbookFactory.CreateWorkbook2<T,U>
createHssfByNode, createHssfFromScratch, createXssfByFile, createXssfByPackage, createXssfByStream, createXssfFromScratch
Constructor and Description |
---|
XSSFWorkbookFactory() |
Modifier and Type | Method and Description |
---|---|
static XSSFWorkbook |
create(OPCPackage pkg)
Creates a XSSFWorkbook from the given OOXML Package.
|
static XSSFWorkbook |
createWorkbook()
Create a new empty Workbook
|
static XSSFWorkbook |
createWorkbook(java.io.File file,
boolean readOnly)
Creates the XSSFWorkbook from the given File, which must exist and be readable.
|
static XSSFWorkbook |
createWorkbook(java.io.InputStream stream)
Creates a XSSFWorkbook from the given InputStream
|
static XSSFWorkbook |
createWorkbook(OPCPackage pkg)
Creates a XSSFWorkbook from the given OOXML Package
|
static XSSFWorkbook |
createWorkbook(ZipPackage pkg)
Creates a XSSFWorkbook from the given OOXML Package
|
public static XSSFWorkbook createWorkbook()
public static XSSFWorkbook create(OPCPackage pkg) throws java.io.IOException
Note that in order to properly release resources the Workbook should be closed after use.
pkg
- The OPCPackage
opened for reading data.java.io.IOException
- if an error occurs while reading the datapublic static XSSFWorkbook createWorkbook(ZipPackage pkg) throws java.io.IOException
Note that in order to properly release resources the Workbook should be closed after use.
pkg
- The ZipPackage
opened for reading data.java.io.IOException
- if an error occurs while reading the datapublic static XSSFWorkbook createWorkbook(OPCPackage pkg) throws java.io.IOException
Note that in order to properly release resources the Workbook should be closed after use.
pkg
- The OPCPackage
opened for reading data.java.io.IOException
- if an error occurs while reading the datapublic static XSSFWorkbook createWorkbook(java.io.File file, boolean readOnly) throws java.io.IOException
Note that in order to properly release resources the Workbook should be closed after use.
file
- The file to read data from.readOnly
- If the Workbook should be opened in read-only mode to avoid writing back
changes when the document is closed.java.io.IOException
- if an error occurs while reading the dataEncryptedDocumentException
- If the wrong password is given for a protected filepublic static XSSFWorkbook createWorkbook(java.io.InputStream stream) throws java.io.IOException
Note that in order to properly release resources the Workbook should be closed after use.
stream
- The InputStream
to read data from.java.io.IOException
- if an error occurs while reading the dataCopyright 2020 The Apache Software Foundation or its licensors, as applicable.