List of usage examples for org.apache.poi.hpsf SummaryInformation getLastAuthor
public String getLastAuthor()
From source file:com.flexive.extractor.FxSummaryInformation.java
License:Open Source License
/** * Constructor.//from w w w . j a va2 s . c om * * @param si the summary information */ public FxSummaryInformation(SummaryInformation si) { author = si.getAuthor(); applicationName = si.getApplicationName(); charCount = si.getCharCount(); comments = si.getComments(); createdAt = si.getCreateDateTime(); editTime = new Date(si.getEditTime()); keywords = si.getKeywords(); lastModifiedBy = si.getLastAuthor(); lastPrintedAt = si.getLastPrinted(); title = si.getTitle(); lastModifiedAt = si.getLastSaveDateTime(); pageCount = si.getPageCount(); revNumber = si.getRevNumber(); wordCount = si.getWordCount(); encrypted = false; }
From source file:com.openkm.util.metadata.MetadataExtractor.java
License:Open Source License
/** * Extract metadata from Office Word//from ww w . j a va 2s . c om */ public static OfficeMetadata officeExtractor(InputStream is, String mimeType) throws IOException { POIFSFileSystem fs = new POIFSFileSystem(is); OfficeMetadata md = new OfficeMetadata(); SummaryInformation si = null; if (MimeTypeConfig.MIME_MS_WORD.equals(mimeType)) { si = new WordExtractor(fs).getSummaryInformation(); } else if (MimeTypeConfig.MIME_MS_EXCEL.equals(mimeType)) { si = new ExcelExtractor(fs).getSummaryInformation(); } else if (MimeTypeConfig.MIME_MS_POWERPOINT.equals(mimeType)) { si = new PowerPointExtractor(fs).getSummaryInformation(); } if (si != null) { md.setTitle(si.getTitle()); md.setSubject(si.getSubject()); md.setAuthor(si.getAuthor()); md.setLastAuthor(si.getLastAuthor()); md.setKeywords(si.getKeywords()); md.setComments(si.getComments()); md.setTemplate(si.getTemplate()); md.setRevNumber(si.getRevNumber()); md.setApplicationName(si.getApplicationName()); md.setEditTime(si.getEditTime()); md.setPageCount(si.getPageCount()); md.setWordCount(si.getWordCount()); md.setCharCount(si.getCharCount()); md.setSecurity(si.getSecurity()); Calendar createDateTime = Calendar.getInstance(); createDateTime.setTime(si.getCreateDateTime()); md.setCreateDateTime(createDateTime); Calendar lastSaveDateTime = Calendar.getInstance(); lastSaveDateTime.setTime(si.getLastSaveDateTime()); md.setLastSaveDateTime(lastSaveDateTime); Calendar lastPrinted = Calendar.getInstance(); lastPrinted.setTime(si.getLastPrinted()); md.setLastPrinted(lastPrinted); } log.info("officeExtractor: {}", md); return md; }
From source file:com.pnf.plugin.ole.parser.StreamReader.java
License:Apache License
private List<INode> readSummaryInfoStream(ByteBuffer stream) { List<INode> roots = new LinkedList<>(); String propType = "Property"; try {/*from w w w .j a v a 2 s.com*/ SummaryInformation sInfo = new SummaryInformation(new PropertySet(stream.array())); StreamEntry cInfo = new StreamEntry("Creation Information"); cInfo.addChild(new StreamEntry("Application Name", propType, sInfo.getApplicationName())); cInfo.addChild(new StreamEntry("Creation", "Time", sInfo.getCreateDateTime() != null ? sInfo.getCreateDateTime().toString() : null)); cInfo.addChild(new StreamEntry("Author", propType, sInfo.getAuthor())); cInfo.addChild(new StreamEntry("Last Author", propType, sInfo.getLastAuthor())); cInfo.addChild(new StreamEntry("Template", propType, sInfo.getTemplate())); roots.add(cInfo); propType = "Time"; StreamEntry timeInfo = new StreamEntry("Times"); timeInfo.addChild(new StreamEntry("Total Edit Time", propType, String.valueOf(sInfo.getEditTime()))); timeInfo.addChild(new StreamEntry("Last Saved", propType, sInfo.getLastSaveDateTime() != null ? sInfo.getLastSaveDateTime().toString() : null)); timeInfo.addChild(new StreamEntry("Last Printed", propType, sInfo.getLastPrinted() != null ? sInfo.getLastPrinted().toString() : null)); roots.add(timeInfo); propType = "Misc"; StreamEntry misc = new StreamEntry("Miscellaneous"); misc.addChild(new StreamEntry("OS Version", "int", String.valueOf(sInfo.getOSVersion()))); misc.addChild(new StreamEntry("Revision Number", "int", sInfo.getRevNumber())); misc.addChild(new StreamEntry("Page Count", "int", String.valueOf(sInfo.getPageCount()))); misc.addChild(new StreamEntry("Word Count", "int", String.valueOf(sInfo.getWordCount()))); int secVal = sInfo.getSecurity(); String security = null; if (!sInfo.wasNull()) { // Set description according to POI documentation switch (secVal) { case 0: security = "No security"; break; case 1: security = "Password protected"; break; case 2: security = "Read-only recommended"; break; case 4: security = "Read-only enforced"; break; case 8: security = "Locked for annotations"; break; default: break; } security += " (code " + secVal + ")"; } else { security = "Field not set"; } misc.addChild(new StreamEntry("Document Security", "int", security)); misc.addChild(new StreamEntry("Subject", propType, sInfo.getSubject())); misc.addChild(new StreamEntry("Keywords", propType, sInfo.getKeywords())); roots.add(misc); } catch (Throwable t) { addMessage("Attempted to read " + SUMM_INFO + " stream but no property sets were found.", null, Message.CORRUPT); } return roots; }
From source file:lucee.runtime.poi.Excel.java
License:Open Source License
private void info(Struct sct, SummaryInformation summary) { if (summary == null) return;/*from ww w . j a va 2s.c o m*/ set(sct, "AUTHOR", summary.getAuthor()); set(sct, "APPLICATIONNAME", summary.getApplicationName()); set(sct, "COMMENTS", summary.getComments()); set(sct, "CREATIONDATE", summary.getCreateDateTime()); set(sct, "KEYWORDS", summary.getKeywords()); set(sct, "LASTAUTHOR", summary.getLastAuthor()); set(sct, "LASTEDITED", summary.getEditTime()); set(sct, "LASTSAVED", summary.getLastSaveDateTime()); set(sct, "REVNUMBER", summary.getRevNumber()); set(sct, "SUBJECT", summary.getSubject()); set(sct, "TITLE", summary.getTitle()); set(sct, "TEMPLATE", summary.getTemplate()); }
From source file:mj.ocraptor.extraction.tika.parser.microsoft.SummaryExtractor.java
License:Apache License
private void parse(SummaryInformation summary) { set(TikaCoreProperties.TITLE, summary.getTitle()); set(TikaCoreProperties.CREATOR, summary.getAuthor()); set(TikaCoreProperties.KEYWORDS, summary.getKeywords()); // TODO Move to OO subject in Tika 2.0 set(TikaCoreProperties.TRANSITION_SUBJECT_TO_OO_SUBJECT, summary.getSubject()); set(TikaCoreProperties.MODIFIER, summary.getLastAuthor()); set(TikaCoreProperties.COMMENTS, summary.getComments()); set(OfficeOpenXMLExtended.TEMPLATE, summary.getTemplate()); set(OfficeOpenXMLExtended.APPLICATION, summary.getApplicationName()); set(OfficeOpenXMLCore.REVISION, summary.getRevNumber()); set(TikaCoreProperties.CREATED, summary.getCreateDateTime()); set(TikaCoreProperties.MODIFIED, summary.getLastSaveDateTime()); set(TikaCoreProperties.PRINT_DATE, summary.getLastPrinted()); set(Metadata.EDIT_TIME, summary.getEditTime()); set(OfficeOpenXMLExtended.DOC_SECURITY, summary.getSecurity()); // New style counts set(Office.WORD_COUNT, summary.getWordCount()); set(Office.CHARACTER_COUNT, summary.getCharCount()); set(Office.PAGE_COUNT, summary.getPageCount()); if (summary.getPageCount() > 0) { metadata.set(PagedText.N_PAGES, summary.getPageCount()); }/* w ww . j a v a 2 s . c om*/ // Old style, Tika 1.0 properties // TODO Remove these in Tika 2.0 set(Metadata.TEMPLATE, summary.getTemplate()); set(Metadata.APPLICATION_NAME, summary.getApplicationName()); set(Metadata.REVISION_NUMBER, summary.getRevNumber()); set(Metadata.SECURITY, summary.getSecurity()); set(MSOffice.WORD_COUNT, summary.getWordCount()); set(MSOffice.CHARACTER_COUNT, summary.getCharCount()); set(MSOffice.PAGE_COUNT, summary.getPageCount()); }
From source file:net.sf.mpxj.mpp.ProjectPropertiesReader.java
License:Open Source License
/** * The main entry point for processing project properties. * /*from ww w . j a v a 2s .c o m*/ * @param file parent project file * @param props properties data * @param rootDir Root of the POI file system. */ public void process(ProjectFile file, Props props, DirectoryEntry rootDir) throws MPXJException { try { //MPPUtility.fileDump("c:\\temp\\props.txt", props.toString().getBytes()); ProjectProperties ph = file.getProjectProperties(); ph.setStartDate(props.getTimestamp(Props.PROJECT_START_DATE)); ph.setFinishDate(props.getTimestamp(Props.PROJECT_FINISH_DATE)); ph.setScheduleFrom(ScheduleFrom.getInstance(1 - props.getShort(Props.SCHEDULE_FROM))); ph.setDefaultCalendarName(props.getUnicodeString(Props.DEFAULT_CALENDAR_NAME)); ph.setDefaultStartTime(props.getTime(Props.START_TIME)); ph.setDefaultEndTime(props.getTime(Props.END_TIME)); ph.setStatusDate(props.getTimestamp(Props.STATUS_DATE)); ph.setHyperlinkBase(props.getUnicodeString(Props.HYPERLINK_BASE)); //ph.setDefaultDurationIsFixed(); ph.setDefaultDurationUnits(MPPUtility.getDurationTimeUnits(props.getShort(Props.DURATION_UNITS))); ph.setMinutesPerDay(Integer.valueOf(props.getInt(Props.MINUTES_PER_DAY))); ph.setMinutesPerWeek(Integer.valueOf(props.getInt(Props.MINUTES_PER_WEEK))); ph.setDefaultOvertimeRate(new Rate(props.getDouble(Props.OVERTIME_RATE), TimeUnit.HOURS)); ph.setDefaultStandardRate(new Rate(props.getDouble(Props.STANDARD_RATE), TimeUnit.HOURS)); ph.setDefaultWorkUnits(MPPUtility.getWorkTimeUnits(props.getShort(Props.WORK_UNITS))); ph.setSplitInProgressTasks(props.getBoolean(Props.SPLIT_TASKS)); ph.setUpdatingTaskStatusUpdatesResourceStatus(props.getBoolean(Props.TASK_UPDATES_RESOURCE)); ph.setCurrencyDigits(Integer.valueOf(props.getShort(Props.CURRENCY_DIGITS))); ph.setCurrencySymbol(props.getUnicodeString(Props.CURRENCY_SYMBOL)); ph.setCurrencyCode(props.getUnicodeString(Props.CURRENCY_CODE)); //ph.setDecimalSeparator(); ph.setSymbolPosition(MPPUtility.getSymbolPosition(props.getShort(Props.CURRENCY_PLACEMENT))); //ph.setThousandsSeparator(); ph.setWeekStartDay(Day.getInstance(props.getShort(Props.WEEK_START_DAY) + 1)); ph.setFiscalYearStartMonth(Integer.valueOf(props.getShort(Props.FISCAL_YEAR_START_MONTH))); ph.setFiscalYearStart(props.getShort(Props.FISCAL_YEAR_START) == 1); ph.setDaysPerMonth(Integer.valueOf(props.getShort(Props.DAYS_PER_MONTH))); ph.setEditableActualCosts(props.getBoolean(Props.EDITABLE_ACTUAL_COSTS)); ph.setHonorConstraints(!props.getBoolean(Props.HONOR_CONSTRAINTS)); PropertySet ps = new PropertySet(new DocumentInputStream( ((DocumentEntry) rootDir.getEntry(SummaryInformation.DEFAULT_STREAM_NAME)))); SummaryInformation summaryInformation = new SummaryInformation(ps); ph.setProjectTitle(summaryInformation.getTitle()); ph.setSubject(summaryInformation.getSubject()); ph.setAuthor(summaryInformation.getAuthor()); ph.setKeywords(summaryInformation.getKeywords()); ph.setComments(summaryInformation.getComments()); ph.setTemplate(summaryInformation.getTemplate()); ph.setLastAuthor(summaryInformation.getLastAuthor()); ph.setRevision(NumberHelper.parseInteger(summaryInformation.getRevNumber())); ph.setCreationDate(summaryInformation.getCreateDateTime()); ph.setLastSaved(summaryInformation.getLastSaveDateTime()); ph.setShortApplicationName(summaryInformation.getApplicationName()); ph.setEditingTime(Integer.valueOf((int) summaryInformation.getEditTime())); ph.setLastPrinted(summaryInformation.getLastPrinted()); ps = new PropertySet(new DocumentInputStream( ((DocumentEntry) rootDir.getEntry(DocumentSummaryInformation.DEFAULT_STREAM_NAME)))); ExtendedDocumentSummaryInformation documentSummaryInformation = new ExtendedDocumentSummaryInformation( ps); ph.setCategory(documentSummaryInformation.getCategory()); ph.setPresentationFormat(documentSummaryInformation.getPresentationFormat()); ph.setManager(documentSummaryInformation.getManager()); ph.setCompany(documentSummaryInformation.getCompany()); ph.setContentType(documentSummaryInformation.getContentType()); ph.setContentStatus(documentSummaryInformation.getContentStatus()); ph.setLanguage(documentSummaryInformation.getLanguage()); ph.setDocumentVersion(documentSummaryInformation.getDocumentVersion()); Map<String, Object> customPropertiesMap = new HashMap<String, Object>(); CustomProperties customProperties = documentSummaryInformation.getCustomProperties(); if (customProperties != null) { for (CustomProperty property : customProperties.values()) { customPropertiesMap.put(property.getName(), property.getValue()); } } ph.setCustomProperties(customPropertiesMap); ph.setCalculateMultipleCriticalPaths(props.getBoolean(Props.CALCULATE_MULTIPLE_CRITICAL_PATHS)); ph.setBaselineDate(props.getTimestamp(Props.BASELINE_DATE)); ph.setBaselineDate(1, props.getTimestamp(Props.BASELINE1_DATE)); ph.setBaselineDate(2, props.getTimestamp(Props.BASELINE2_DATE)); ph.setBaselineDate(3, props.getTimestamp(Props.BASELINE3_DATE)); ph.setBaselineDate(4, props.getTimestamp(Props.BASELINE4_DATE)); ph.setBaselineDate(5, props.getTimestamp(Props.BASELINE5_DATE)); ph.setBaselineDate(6, props.getTimestamp(Props.BASELINE6_DATE)); ph.setBaselineDate(7, props.getTimestamp(Props.BASELINE7_DATE)); ph.setBaselineDate(8, props.getTimestamp(Props.BASELINE8_DATE)); ph.setBaselineDate(9, props.getTimestamp(Props.BASELINE9_DATE)); ph.setBaselineDate(10, props.getTimestamp(Props.BASELINE10_DATE)); } catch (Exception ex) { throw new MPXJException(MPXJException.READ_ERROR, ex); } }
From source file:net.sourceforge.docfetcher.parse.MSOfficeParser.java
License:Open Source License
public void processPOIFSReaderEvent(POIFSReaderEvent event) { try {//from w w w .j a va 2 s .c o m SummaryInformation si = (SummaryInformation) PropertySetFactory.create(event.getStream()); // Combine 'author' and 'last author' field if they're identical String author; String defaultAuthor = si.getAuthor(); String lastAuthor = si.getLastAuthor(); if (defaultAuthor.equals(lastAuthor)) author = defaultAuthor; else author = defaultAuthor + ", " + lastAuthor; //$NON-NLS-1$ this.author = author; title = si.getTitle(); subject = si.getSubject(); keywords = si.getKeywords(); comments = si.getComments(); } catch (Exception e) { // Ignore, we can live without meta data } }
From source file:org.alanwilliamson.openbd.plugin.spreadsheet.functions.SpreadsheetInfo.java
License:Open Source License
public cfData execute(cfSession _session, List<cfData> parameters) throws cfmRunTimeException { cfSpreadSheetData spreadsheet = null; spreadsheet = (cfSpreadSheetData) parameters.get(0); Workbook workbook = spreadsheet.getWorkBook(); cfStructData s = new cfStructData(); /*// www. j a v a 2 s.c om * Sheet details */ s.setData("sheets", new cfNumberData(workbook.getNumberOfSheets())); cfArrayData sheetArr = cfArrayData.createArray(1); for (int x = 0; x < workbook.getNumberOfSheets(); x++) { String name = workbook.getSheetName(x); if (name == null) name = ""; sheetArr.addElement(new cfStringData(name)); } s.setData("sheetnames", sheetArr); /* * Workbook type */ if (workbook instanceof XSSFWorkbook) { s.setData("spreadsheettype", new cfStringData("xlsx")); } else { s.setData("spreadsheettype", new cfStringData("xls")); } /* * XSSFWorkbook */ if (workbook instanceof XSSFWorkbook) { XSSFWorkbook xSSFWorkbook = (XSSFWorkbook) workbook; CoreProperties cP = xSSFWorkbook.getProperties().getCoreProperties(); s.setData("category", new cfStringData(cP.getCategory())); s.setData("subject", new cfStringData(cP.getSubject())); s.setData("title", new cfStringData(cP.getTitle())); s.setData("revision", new cfStringData(cP.getRevision())); s.setData("author", new cfStringData(cP.getCreator())); s.setData("description", new cfStringData(cP.getDescription())); if (cP.getLastPrinted() != null) s.setData("lastprinted", new cfDateData(cP.getLastPrinted())); if (cP.getModified() != null) s.setData("lastsaved", new cfDateData(cP.getModified())); if (cP.getCreated() != null) s.setData("creationdate", new cfDateData(cP.getCreated())); } else { HSSFWorkbook hSSFWorkbook = (HSSFWorkbook) workbook; DocumentSummaryInformation dSummary = hSSFWorkbook.getDocumentSummaryInformation(); if (dSummary == null) { s.setData("category", cfStringData.EMPTY_STRING); s.setData("company", cfStringData.EMPTY_STRING); s.setData("manager", cfStringData.EMPTY_STRING); } else { s.setData("category", new cfStringData(dSummary.getCategory())); s.setData("company", new cfStringData(dSummary.getCompany())); s.setData("manager", new cfStringData(dSummary.getManager())); } SummaryInformation sInformation = hSSFWorkbook.getSummaryInformation(); if (sInformation == null) { s.setData("author", cfStringData.EMPTY_STRING); s.setData("comments", cfStringData.EMPTY_STRING); s.setData("keywords", cfStringData.EMPTY_STRING); s.setData("lastauthor", cfStringData.EMPTY_STRING); s.setData("title", cfStringData.EMPTY_STRING); s.setData("subject", cfStringData.EMPTY_STRING); } else { s.setData("author", new cfStringData(sInformation.getAuthor())); s.setData("comments", new cfStringData(sInformation.getComments())); s.setData("keywords", new cfStringData(sInformation.getKeywords())); s.setData("lastauthor", new cfStringData(sInformation.getLastAuthor())); s.setData("title", new cfStringData(sInformation.getTitle())); s.setData("subject", new cfStringData(sInformation.getSubject())); if (sInformation.getCreateDateTime() != null) s.setData("creationdate", new cfDateData(sInformation.getCreateDateTime())); if (sInformation.getLastSaveDateTime() != null) s.setData("lastsaved", new cfDateData(sInformation.getLastSaveDateTime())); if (sInformation.getLastPrinted() != null) s.setData("lastprinted", new cfDateData(sInformation.getLastPrinted())); } } return s; }
From source file:org.apache.tika.parser.microsoft.SummaryExtractor.java
License:Apache License
private void parse(SummaryInformation summary) { set(TikaCoreProperties.TITLE, summary.getTitle()); addMulti(metadata, TikaCoreProperties.CREATOR, summary.getAuthor()); set(TikaCoreProperties.KEYWORDS, summary.getKeywords()); // TODO Move to OO subject in Tika 2.0 set(TikaCoreProperties.TRANSITION_SUBJECT_TO_OO_SUBJECT, summary.getSubject()); set(TikaCoreProperties.MODIFIER, summary.getLastAuthor()); set(TikaCoreProperties.COMMENTS, summary.getComments()); set(OfficeOpenXMLExtended.TEMPLATE, summary.getTemplate()); set(OfficeOpenXMLExtended.APPLICATION, summary.getApplicationName()); set(OfficeOpenXMLCore.REVISION, summary.getRevNumber()); set(TikaCoreProperties.CREATED, summary.getCreateDateTime()); set(TikaCoreProperties.MODIFIED, summary.getLastSaveDateTime()); set(TikaCoreProperties.PRINT_DATE, summary.getLastPrinted()); set(Metadata.EDIT_TIME, summary.getEditTime()); set(OfficeOpenXMLExtended.DOC_SECURITY, summary.getSecurity()); // New style counts set(Office.WORD_COUNT, summary.getWordCount()); set(Office.CHARACTER_COUNT, summary.getCharCount()); set(Office.PAGE_COUNT, summary.getPageCount()); if (summary.getPageCount() > 0) { metadata.set(PagedText.N_PAGES, summary.getPageCount()); }/* w w w . j a v a 2s . c o m*/ // Old style, Tika 1.0 properties // TODO Remove these in Tika 2.0 set(Metadata.TEMPLATE, summary.getTemplate()); set(Metadata.APPLICATION_NAME, summary.getApplicationName()); set(Metadata.REVISION_NUMBER, summary.getRevNumber()); set(Metadata.SECURITY, summary.getSecurity()); set(MSOffice.WORD_COUNT, summary.getWordCount()); set(MSOffice.CHARACTER_COUNT, summary.getCharCount()); set(MSOffice.PAGE_COUNT, summary.getPageCount()); }
From source file:org.exoplatform.services.document.impl.POIPropertiesReader.java
License:Open Source License
/** * Metadata extraction from OLE2 documents (legacy MS office file formats) * /*from w w w . j av a 2s.com*/ * @param is * @return * @throws IOException * @throws DocumentReadException */ public Properties readDCProperties(final InputStream is) throws IOException, DocumentReadException { if (is == null) { throw new IllegalArgumentException("InputStream is null."); } @SuppressWarnings("serial") class POIRuntimeException extends RuntimeException { private Throwable ex; public POIRuntimeException(Throwable ex) { this.ex = ex; } public Throwable getException() { return ex; } } POIFSReaderListener readerListener = new POIFSReaderListener() { public void processPOIFSReaderEvent(final POIFSReaderEvent event) { PropertySet ps; try { ps = PropertySetFactory.create(event.getStream()); if (ps instanceof SummaryInformation) { SummaryInformation si = (SummaryInformation) ps; if (si.getLastAuthor() != null && si.getLastAuthor().length() > 0) { props.put(DCMetaData.CONTRIBUTOR, si.getLastAuthor()); } if (si.getComments() != null && si.getComments().length() > 0) { props.put(DCMetaData.DESCRIPTION, si.getComments()); } if (si.getCreateDateTime() != null) { props.put(DCMetaData.DATE, si.getCreateDateTime()); } if (si.getAuthor() != null && si.getAuthor().length() > 0) { props.put(DCMetaData.CREATOR, si.getAuthor()); } if (si.getKeywords() != null && si.getKeywords().length() > 0) { props.put(DCMetaData.SUBJECT, si.getKeywords()); } if (si.getLastSaveDateTime() != null) { props.put(DCMetaData.DATE, si.getLastSaveDateTime()); } // if(docInfo.getProducer() != null) // props.put(DCMetaData.PUBLISHER, docInfo.getProducer()); if (si.getSubject() != null && si.getSubject().length() > 0) { props.put(DCMetaData.SUBJECT, si.getSubject()); } if (si.getTitle() != null && si.getTitle().length() > 0) { props.put(DCMetaData.TITLE, si.getTitle()); } } } catch (NoPropertySetStreamException e) { throw new POIRuntimeException(new DocumentReadException(e.getMessage(), e)); } catch (MarkUnsupportedException e) { throw new POIRuntimeException(new DocumentReadException(e.getMessage(), e)); } catch (UnsupportedEncodingException e) { throw new POIRuntimeException(new DocumentReadException(e.getMessage(), e)); } catch (IOException e) { throw new POIRuntimeException(e); } } }; try { final POIFSReader poiFSReader = new POIFSReader(); poiFSReader.registerListener(readerListener, SummaryInformation.DEFAULT_STREAM_NAME); SecurityHelper.doPrivilegedIOExceptionAction(new PrivilegedExceptionAction<Void>() { public Void run() throws Exception { poiFSReader.read(is); return null; } }); } catch (POIRuntimeException e) { Throwable ex = e.getException(); if (ex instanceof IOException) { throw (IOException) ex; } else { throw (DocumentReadException) ex; } } finally { if (is != null) { try { is.close(); } catch (IOException e) { if (LOG.isTraceEnabled()) { LOG.trace("An exception occurred: " + e.getMessage()); } } } } return props; }