List of usage examples for org.apache.poi.hpsf PropertySet isDocumentSummaryInformation
public boolean isDocumentSummaryInformation()
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 {// w ww. j ava 2s . com 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 {//w ww . j a v a 2 s. co 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); } }