Package org.apache.poi.xssf.usermodel
Class XSSFWorkbookFactory
java.lang.Object
org.apache.poi.xssf.usermodel.XSSFWorkbookFactory
- All Implemented Interfaces:
WorkbookProvider
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleancreate()Create a new empty WorkbookCreates the XSSFWorkbook from the given File, which must exist and be readable.create(InputStream stream) Creates a XSSFWorkbook from the given InputStreamcreate(InputStream inp, String password) create(DirectoryNode root, String password) static XSSFWorkbookcreateWorkbook(OPCPackage pkg) Creates a XSSFWorkbook from the given OOXML Package
-
Constructor Details
-
XSSFWorkbookFactory
public XSSFWorkbookFactory()
-
-
Method Details
-
accepts
- Specified by:
acceptsin interfaceWorkbookProvider
-
create
Create a new empty Workbook- Specified by:
createin interfaceWorkbookProvider- Returns:
- The created workbook
-
create
- Specified by:
createin interfaceWorkbookProvider- Throws:
IOException
-
create
- Specified by:
createin interfaceWorkbookProvider- Throws:
IOException
-
create
Creates a XSSFWorkbook from the given InputStreamNote that in order to properly release resources the Workbook should be closed after use.
- Specified by:
createin interfaceWorkbookProvider- Parameters:
stream- TheInputStreamto read data from.- Returns:
- The created Workbook
- Throws:
IOException- if an error occurs while reading the data
-
createWorkbook
Creates a XSSFWorkbook from the given OOXML PackageNote that in order to properly release resources the Workbook should be closed after use.
- Parameters:
pkg- TheOPCPackageopened for reading data.- Returns:
- The created Workbook
- Throws:
IOException- if an error occurs while reading the data
-
create
Creates the XSSFWorkbook from the given File, which must exist and be readable.Note that in order to properly release resources the Workbook should be closed after use.
- Specified by:
createin interfaceWorkbookProvider- Parameters:
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.- Returns:
- The created Workbook
- Throws:
IOException- if an error occurs while reading the dataEncryptedDocumentException- If the wrong password is given for a protected file
-