Hello, org.apache.poi.openxml4j.exceptions.InvalidFormatException is a checked exception from WorkbookFactory.create(inStream).
I don't see how we can remove it without removing use of the checked exception... which I guess would mean forking POI. With kind regards, Mike On 23 March 2013 13:19, Cristiano Gavião <cvgav...@gmail.com> wrote: > Hi, > > I'm getting a problem with the org.apache.poi.openxml4j.exceptions package > in my osgi things. I could not find a bundle that exports such package. > > Investigating a bit, the unique class that I could find using this api is > org.drools.decisiontable.parser.xls.ExcelParser, but only > org.apache.poi.openxml4j.exceptions.InvalidFormatException class. > > is this api really needed? > > public void parseFile(InputStream inStream) { > try { > Workbook workbook = WorkbookFactory.create(inStream); > > if ( _useFirstSheet ) { > Sheet sheet = workbook.getSheetAt( 0 ); > processSheet( sheet, _listeners.get( > DEFAULT_RULESHEET_NAME ) ); > } else { > for ( String sheetName : _listeners.keySet() ) { > Sheet sheet = workbook.getSheet( sheetName ); > if (sheet == null) { > throw new IllegalStateException("Could not find > the sheetName (" + sheetName > + ") in the > workbook sheetNames."); > } > processSheet( sheet, > _listeners.get( sheetName ) ); > > } > } > } catch ( *InvalidFormatException* e ) { > throw new DecisionTableParseException( "An error occurred > opening the workbook. It is possible that the encoding of the document did > not match the encoding of the reader.", > e ); > > } catch ( IOException e ) { > throw new DecisionTableParseException( "Failed to open Excel > stream, " + "please check that the content is xls97 format.", > e ); > } > > } > > > > all other behavior is being supported by org/apache/poi/poi/3.9/poi-3.9.jar > > > regards, > > Cristiano > > _______________________________________________ > rules-dev mailing list > rules-dev@lists.jboss.org > https://lists.jboss.org/mailman/listinfo/rules-dev >
_______________________________________________ rules-dev mailing list rules-dev@lists.jboss.org https://lists.jboss.org/mailman/listinfo/rules-dev