Example usage for org.apache.poi.xslf.usermodel XSLFRelation COMMENT_AUTHORS

List of usage examples for org.apache.poi.xslf.usermodel XSLFRelation COMMENT_AUTHORS

Introduction

In this page you can find the example usage for org.apache.poi.xslf.usermodel XSLFRelation COMMENT_AUTHORS.

Prototype

XSLFRelation COMMENT_AUTHORS

To view the source code for org.apache.poi.xslf.usermodel XSLFRelation COMMENT_AUTHORS.

Click Source Link

Usage

From source file:org.apache.tika.parser.microsoft.ooxml.SXSLFPowerPointExtractorDecorator.java

License:Apache License

private void loadCommentAuthors() {
    PackageRelationshipCollection prc = null;
    try {//ww  w .  j  a v  a  2s . c  om
        prc = mainDocument.getRelationshipsByType(XSLFRelation.COMMENT_AUTHORS.getRelation());
    } catch (InvalidFormatException e) {
    }
    if (prc == null || prc.size() == 0) {
        return;
    }

    for (int i = 0; i < prc.size(); i++) {
        PackagePart commentAuthorsPart = null;
        try {
            commentAuthorsPart = commentAuthorsPart = mainDocument.getRelatedPart(prc.getRelationship(i));
        } catch (InvalidFormatException e) {

        }
        if (commentAuthorsPart == null) {
            continue;
        }
        try (InputStream stream = commentAuthorsPart.getInputStream()) {
            context.getSAXParser().parse(new CloseShieldInputStream(stream),
                    new OfflineContentHandler(new XSLFCommentAuthorHandler()));

        } catch (TikaException | SAXException | IOException e) {
            //do something with this
        }
    }

}