public class XSSFWorkbookFactory extends WorkbookFactory
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, InvalidFormatException
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 fileInvalidFormatException
public static XSSFWorkbook createWorkbook(java.io.InputStream stream) throws java.io.IOException, InvalidFormatException
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 dataInvalidFormatException
- if the package is not valid.Copyright 2018 The Apache Software Foundation or its licensors, as applicable.