public String getDocumentSummaryInformationText() { if(document == null) { // event based extractor does not have a document return ""; } DocumentSummaryInformation dsi = document.getDocumentSummaryInformation(); StringBuilder text = new StringBuilder(); // Normal properties text.append( getPropertiesText(dsi) ); // Now custom ones CustomProperties cps = dsi == null ? null : dsi.getCustomProperties(); if (cps != null) { for (String key : cps.nameSet()) { String val = getPropertyValueText(cps.get(key)); text.append(key).append(" = ").append(val).append("\n"); } } // All done return text.toString(); } public String getSummaryInformationText() {
private String getLanguage(DocumentSummaryInformation summary) { CustomProperties customProperties = summary.getCustomProperties(); if (customProperties != null) { Object value = customProperties.get("Language"); if (value instanceof String) { return (String) value; } } return null; }
private void parse(DocumentSummaryInformation summary) { set(OfficeOpenXMLExtended.COMPANY, summary.getCompany()); addMulti(metadata, OfficeOpenXMLExtended.MANAGER, summary.getManager()); set(TikaCoreProperties.LANGUAGE, getLanguage(summary)); set(OfficeOpenXMLCore.CATEGORY, summary.getCategory()); // New style counts set(Office.SLIDE_COUNT, summary.getSlideCount()); if (summary.getSlideCount() > 0) { metadata.set(PagedText.N_PAGES, summary.getSlideCount()); } parse(summary.getCustomProperties()); }
private String getLanguage(DocumentSummaryInformation summary) { CustomProperties customProperties = summary.getCustomProperties(); if (customProperties != null) { Object value = customProperties.get("Language"); if (value instanceof String) { return (String) value; } } return null; }
private String getLanguage(DocumentSummaryInformation summary) { CustomProperties customProperties = summary.getCustomProperties(); if (customProperties != null) { Object value = customProperties.get("Language"); if (value instanceof String) { return (String) value; } } return null; }
public String getDocumentSummaryInformationText() { DocumentSummaryInformation dsi = document.getDocumentSummaryInformation(); StringBuffer text = new StringBuffer(); // Normal properties text.append( getPropertiesText(dsi) ); // Now custom ones CustomProperties cps = dsi == null ? null : dsi.getCustomProperties(); if(cps != null) { Iterator<String> keys = cps.nameSet().iterator(); while(keys.hasNext()) { String key = keys.next(); String val = getPropertyValueText( cps.get(key) ); text.append(key + " = " + val + "\n"); } } // All done return text.toString(); } public String getSummaryInformationText() {
public String getDocumentSummaryInformationText() { DocumentSummaryInformation dsi = document.getDocumentSummaryInformation(); StringBuffer text = new StringBuffer(); // Normal properties text.append( getPropertiesText(dsi) ); // Now custom ones CustomProperties cps = dsi == null ? null : dsi.getCustomProperties(); if(cps != null) { Iterator<String> keys = cps.nameSet().iterator(); while(keys.hasNext()) { String key = keys.next(); String val = getPropertyValueText( cps.get(key) ); text.append(key + " = " + val + "\n"); } } // All done return text.toString(); } public String getSummaryInformationText() {
public String getDocumentSummaryInformationText() { if(document == null) { // event based extractor does not have a document return ""; } DocumentSummaryInformation dsi = document.getDocumentSummaryInformation(); StringBuilder text = new StringBuilder(); // Normal properties text.append( getPropertiesText(dsi) ); // Now custom ones CustomProperties cps = dsi == null ? null : dsi.getCustomProperties(); if (cps != null) { for (String key : cps.nameSet()) { String val = getPropertyValueText(cps.get(key)); text.append(key).append(" = ").append(val).append("\n"); } } // All done return text.toString(); } public String getSummaryInformationText() {
CustomProperties customProperties = dsi.getCustomProperties(); if (customProperties == null) customProperties = new CustomProperties();
private void parse(DocumentSummaryInformation summary) { set(OfficeOpenXMLExtended.COMPANY, summary.getCompany()); addMulti(metadata, OfficeOpenXMLExtended.MANAGER, summary.getManager()); set(TikaCoreProperties.LANGUAGE, getLanguage(summary)); set(OfficeOpenXMLCore.CATEGORY, summary.getCategory()); // New style counts set(Office.SLIDE_COUNT, summary.getSlideCount()); if (summary.getSlideCount() > 0) { metadata.set(PagedText.N_PAGES, summary.getSlideCount()); } // Old style, Tika 1.0 counts // TODO Remove these in Tika 2.0 set(Metadata.COMPANY, summary.getCompany()); set(Metadata.MANAGER, summary.getManager()); set(MSOffice.SLIDE_COUNT, summary.getSlideCount()); set(Metadata.CATEGORY, summary.getCategory()); parse(summary.getCustomProperties()); }
private void parse(DocumentSummaryInformation summary) { set(OfficeOpenXMLExtended.COMPANY, summary.getCompany()); addMulti(metadata, OfficeOpenXMLExtended.MANAGER, summary.getManager()); set(TikaCoreProperties.LANGUAGE, getLanguage(summary)); set(OfficeOpenXMLCore.CATEGORY, summary.getCategory()); // New style counts set(Office.SLIDE_COUNT, summary.getSlideCount()); if (summary.getSlideCount() > 0) { metadata.set(PagedText.N_PAGES, summary.getSlideCount()); } // Old style, Tika 1.0 counts // TODO Remove these in Tika 2.0 set(Metadata.COMPANY, summary.getCompany()); set(Metadata.MANAGER, summary.getManager()); set(MSOffice.SLIDE_COUNT, summary.getSlideCount()); set(Metadata.CATEGORY, summary.getCategory()); parse(summary.getCustomProperties()); }
CustomProperties customProperties = documentSummaryInformation.getCustomProperties(); if (customProperties != null)
CustomProperties customProperties = documentSummaryInformation.getCustomProperties(); if (customProperties != null)