Example usage for org.apache.poi.xssf.usermodel XSSFRelation SHARED_STRINGS

List of usage examples for org.apache.poi.xssf.usermodel XSSFRelation SHARED_STRINGS

Introduction

In this page you can find the example usage for org.apache.poi.xssf.usermodel XSSFRelation SHARED_STRINGS.

Prototype

XSSFRelation SHARED_STRINGS

To view the source code for org.apache.poi.xssf.usermodel XSSFRelation SHARED_STRINGS.

Click Source Link

Usage

From source file:excelimporter.reader.readers.ReadOnlySharedStringsTable.java

License:Apache License

/**
 * @param pkg//from   ww w  . j  a va2 s.  com
 * @throws IOException
 * @throws SAXException
 * @throws ParserConfigurationException
 */
public ReadOnlySharedStringsTable(OPCPackage pkg) throws IOException, SAXException {
    ArrayList<PackagePart> parts = pkg.getPartsByContentType(XSSFRelation.SHARED_STRINGS.getContentType());

    // Some workbooks have no shared strings table.
    if (parts.size() > 0) {
        PackagePart sstPart = parts.get(0);
        readFrom(sstPart.getInputStream());
    }
}