@ Override public boolean addLinkedWorkbook ( String name , InputStream inputStream , String password ) throws FormatNotUnderstoodException { // check if already added if ( this . addedFormulaEvaluators . containsKey ( name ) ) { return false ; } LOG . debug ( "Start adding \"" + name + "\" to current workbook" ) ; // create new parser, select all sheets, no linkedworkbookpasswords,no metadatafilter HadoopOfficeReadConfiguration linkedWBHOCR = new HadoopOfficeReadConfiguration ( ) ; linkedWBHOCR . setLocale ( this . hocr . getLocale ( ) ) ; linkedWBHOCR . setSheets ( null ) ; linkedWBHOCR . setIgnoreMissingLinkedWorkbooks ( this . hocr . getIgnoreMissingLinkedWorkbooks ( ) ) ; linkedWBHOCR . setFileName ( name ) ; linkedWBHOCR . setPassword ( password ) ; linkedWBHOCR . setMetaDataFilter ( null ) ; MSExcelParser linkedWBMSExcelParser = new MSExcelParser ( linkedWBHOCR , null ) ; // parse workbook linkedWBMSExcelParser . parse ( inputStream ) ; // add linked workbook this . addedWorkbooks . add ( linkedWBMSExcelParser . getCurrentWorkbook ( ) ) ; this . addedFormulaEvaluators . put ( name , linkedWBMSExcelParser . getCurrentFormulaEvaluator ( ) ) ; this . formulaEvaluator . setupReferencedWorkbooks ( addedFormulaEvaluators ) ; return true ; }
Adds a linked workbook that is referred from this workbook . If the filename is already in the list then it is not processed twice . Note that the inputStream is closed after parsing