use of org.apache.poi.hpsf.UnexpectedPropertySetTypeException in project tika by apache.
the class SummaryExtractor method parseSummaryEntryIfExists.
private void parseSummaryEntryIfExists(DirectoryNode root, String entryName) throws IOException, TikaException {
try {
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) {
LOG.warn("Ignoring unexpected exception while parsing summary entry {}", entryName, e);
}
}
Aggregations