Example usage for org.apache.poi.hpsf PropertySet isSummaryInformation

List of usage examples for org.apache.poi.hpsf PropertySet isSummaryInformation

Introduction

In this page you can find the example usage for org.apache.poi.hpsf PropertySet isSummaryInformation.

Prototype

public boolean isSummaryInformation() 

Source Link

Document

Checks whether this PropertySet represents a Summary Information.

Usage

From source file:mj.ocraptor.extraction.tika.parser.microsoft.SummaryExtractor.java

License:Apache License

private void parseSummaryEntryIfExists(DirectoryNode root, String entryName) throws IOException, TikaException {
    try {// ww  w  .ja  v  a  2 s .  c o m
        DocumentEntry entry = (DocumentEntry) root.getEntry(entryName);
        PropertySet properties = new PropertySet(new DocumentInputStream(entry));
        if (properties.isSummaryInformation()) {
            parse(new SummaryInformation(properties));
        }
        if (properties.isDocumentSummaryInformation()) {
            parse(new DocumentSummaryInformation(properties));
        }
    } catch (FileNotFoundException e) {
        // entry does not exist, just skip it
    } catch (NoPropertySetStreamException e) {
        // no property stream, just skip it
    } catch (UnexpectedPropertySetTypeException e) {
        throw new TikaException("Unexpected HPSF document", e);
    } catch (MarkUnsupportedException e) {
        throw new TikaException("Invalid DocumentInputStream", e);
    } catch (Exception e) {
        LOGGER.warn("Ignoring unexpected exception while parsing summary entry " + entryName, e);
    }
}

From source file:org.apache.tika.parser.microsoft.SummaryExtractor.java

License:Apache License

private void parseSummaryEntryIfExists(DirectoryNode root, String entryName) throws IOException, TikaException {
    try {//from  w ww.jav  a  2 s.c om
        DocumentEntry entry = (DocumentEntry) root.getEntry(entryName);
        PropertySet properties = new PropertySet(new DocumentInputStream(entry));
        if (properties.isSummaryInformation()) {
            parse(new SummaryInformation(properties));
        }
        if (properties.isDocumentSummaryInformation()) {
            parse(new DocumentSummaryInformation(properties));
        }
    } catch (FileNotFoundException e) {
        // entry does not exist, just skip it
    } catch (NoPropertySetStreamException e) {
        // no property stream, just skip it
    } catch (UnexpectedPropertySetTypeException e) {
        throw new TikaException("Unexpected HPSF document", e);
    } catch (MarkUnsupportedException e) {
        throw new TikaException("Invalid DocumentInputStream", e);
    } catch (Exception e) {
        logger.warn("Ignoring unexpected exception while parsing summary entry " + entryName, e);
    }
}