@Internal public class XSSFWorkbookFactory extends java.lang.Object implements WorkbookProvider
Constructor and Description |
---|
XSSFWorkbookFactory() |
Modifier and Type | Method and Description |
---|---|
boolean |
accepts(FileMagic fm) |
XSSFWorkbook |
create()
Create a new empty Workbook
|
XSSFWorkbook |
create(DirectoryNode root,
java.lang.String password) |
XSSFWorkbook |
create(java.io.File file,
java.lang.String password,
boolean readOnly)
Creates the XSSFWorkbook from the given File, which must exist and be readable.
|
XSSFWorkbook |
create(java.io.InputStream stream)
Creates a XSSFWorkbook from the given InputStream
|
Workbook |
create(java.io.InputStream inp,
java.lang.String password) |
static XSSFWorkbook |
createWorkbook(OPCPackage pkg)
Creates a XSSFWorkbook from the given OOXML Package
|
public boolean accepts(FileMagic fm)
accepts
in interface WorkbookProvider
public XSSFWorkbook create()
create
in interface WorkbookProvider
public XSSFWorkbook create(DirectoryNode root, java.lang.String password) throws java.io.IOException
create
in interface WorkbookProvider
java.io.IOException
public Workbook create(java.io.InputStream inp, java.lang.String password) throws java.io.IOException
create
in interface WorkbookProvider
java.io.IOException
public XSSFWorkbook create(java.io.InputStream stream) throws java.io.IOException
Note that in order to properly release resources the Workbook should be closed after use.
create
in interface WorkbookProvider
stream
- The InputStream
to read data from.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 XSSFWorkbook create(java.io.File file, java.lang.String password, boolean readOnly) throws java.io.IOException
Note that in order to properly release resources the Workbook should be closed after use.
create
in interface WorkbookProvider
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 fileCopyright 2022 The Apache Software Foundation or its licensors, as applicable.