public class WorkbookFactory extends Object
HSSFWorkbook or XSSFWorkbook),
by auto-detecting from the supplied input.| Constructor and Description |
|---|
WorkbookFactory() |
| Modifier and Type | Method and Description |
|---|---|
static Workbook |
create(File file)
Creates the appropriate HSSFWorkbook / XSSFWorkbook from
the given File, which must exist and be readable.
|
static Workbook |
create(InputStream inp)
Creates the appropriate HSSFWorkbook / XSSFWorkbook from
the given InputStream.
|
static Workbook |
create(NPOIFSFileSystem fs)
Creates a HSSFWorkbook from the given NPOIFSFileSystem
|
static Workbook |
create(OPCPackage pkg)
Creates a XSSFWorkbook from the given OOXML Package
|
static Workbook |
create(POIFSFileSystem fs)
Creates a HSSFWorkbook from the given POIFSFileSystem
|
public static Workbook create(POIFSFileSystem fs) throws IOException
IOExceptionpublic static Workbook create(NPOIFSFileSystem fs) throws IOException
IOExceptionpublic static Workbook create(OPCPackage pkg) throws IOException
IOExceptionpublic static Workbook create(InputStream inp) throws IOException, InvalidFormatException
Your input stream MUST either support mark/reset, or
be wrapped as a PushbackInputStream! Note that
using an InputStream has a higher memory footprint
than using a File.
IOExceptionInvalidFormatExceptionpublic static Workbook create(File file) throws IOException, InvalidFormatException
IOExceptionInvalidFormatExceptionCopyright © 2020. All rights reserved.