Package org.apache.poi.hssf.usermodel
Class HSSFWorkbookFactory
- java.lang.Object
-
- org.apache.poi.hssf.usermodel.HSSFWorkbookFactory
-
- All Implemented Interfaces:
WorkbookProvider
@Internal public class HSSFWorkbookFactory extends Object implements WorkbookProvider
Helper class which is instantiated by reflection fromWorkbookFactory.create(java.io.File)
and similar
-
-
Constructor Summary
Constructors Constructor Description HSSFWorkbookFactory()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
accepts(FileMagic fm)
HSSFWorkbook
create()
Create a new empty WorkbookWorkbook
create(File file, String password, boolean readOnly)
Workbook
create(InputStream inp)
Workbook
create(InputStream inp, String password)
HSSFWorkbook
create(DirectoryNode root, String password)
Creates a HSSFWorkbook from the given DirectoryNodestatic HSSFWorkbook
createWorkbook(POIFSFileSystem fs)
Creates a HSSFWorkbook from the givenPOIFSFileSystem
-
-
-
Method Detail
-
accepts
public boolean accepts(FileMagic fm)
- Specified by:
accepts
in interfaceWorkbookProvider
-
create
public HSSFWorkbook create()
Create a new empty Workbook- Specified by:
create
in interfaceWorkbookProvider
- Returns:
- The created workbook
-
createWorkbook
public static HSSFWorkbook createWorkbook(POIFSFileSystem fs) throws IOException
Creates a HSSFWorkbook from the givenPOIFSFileSystem
Note that in order to properly release resources the Workbook should be closed after use.
- Throws:
IOException
-
create
public HSSFWorkbook create(DirectoryNode root, String password) throws IOException
Creates a HSSFWorkbook from the given DirectoryNodeNote that in order to properly release resources the Workbook should be closed after use.
- Specified by:
create
in interfaceWorkbookProvider
- Throws:
IOException
-
create
public Workbook create(InputStream inp) throws IOException
- Specified by:
create
in interfaceWorkbookProvider
- Throws:
IOException
-
create
public Workbook create(InputStream inp, String password) throws IOException
- Specified by:
create
in interfaceWorkbookProvider
- Throws:
IOException
-
create
public Workbook create(File file, String password, boolean readOnly) throws IOException
- Specified by:
create
in interfaceWorkbookProvider
- Throws:
IOException
-
-