Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.poi.ss.usermodel
Class WorkbookFactory

    java.lang.Object
      org.apache.poi.ss.usermodel.WorkbookFactory

    public class WorkbookFactory

extends java.lang.Object

Factory for creating the appropriate kind of Workbook (be it HSSFWorkbook or XSSFWorkbook), from the given input

Constructor Summary
`WorkbookFactory()`

Method Summary
`static org.apache.poi.ss.usermodel.Workbook` | `create(java.io.InputStream inp)` Creates the appropriate HSSFWorkbook / XSSFWorkbook from the given InputStream.
`static org.apache.poi.ss.usermodel.Workbook` | `create(OPCPackage pkg)` Creates an XSSFWorkbook from the given OOXML Package
`static org.apache.poi.ss.usermodel.Workbook` | `create(org.apache.poi.poifs.filesystem.POIFSFileSystem fs)` Creates an HSSFWorkbook from the given POIFSFileSystem

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### WorkbookFactory

    public WorkbookFactory()

Method Detail

### create

    public static org.apache.poi.ss.usermodel.Workbook create(org.apache.poi.poifs.filesystem.POIFSFileSystem fs)
                                                       throws java.io.IOException

  Creates an HSSFWorkbook from the given POIFSFileSystem

  Throws:
    `java.io.IOException`

### create

    public static org.apache.poi.ss.usermodel.Workbook create(OPCPackage pkg)
                                                       throws java.io.IOException

  Creates an XSSFWorkbook from the given OOXML Package

  Throws:
    `java.io.IOException`

### create

    public static org.apache.poi.ss.usermodel.Workbook create(java.io.InputStream inp)
                                                       throws java.io.IOException,
                                                              InvalidFormatException

  Creates the appropriate HSSFWorkbook / XSSFWorkbook from the given InputStream. Your input stream MUST either support mark/reset, or be wrapped as a `PushbackInputStream`!

  Throws:
    `java.io.IOException`
    `InvalidFormatException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD