Hi! Sorry, we're performing some Excel logic inside EJB (JBoss AS 6.0.0) so no files -- only streams. Is there any way to force using NPOIFS? We do need to overcome original exception (e.g. we don't want to use JExcelApi for some files and POI for others).
Thanks! 2011/12/11 Nick Burch <[email protected]> > On Sun, 11 Dec 2011, Ilia Ternovich wrote: > >> But how can I force WorkbookFactory to always use NPOIFSFileSystem? >> > > Use the File constructor rather than the InputStream one, that use NPOIFS > > > My code is: >> Workbook wb = WorkbookFactory.create(new FileInputStream(filename)); >> > > Even if you didn't have a NPOIFS vs POIFS preference, you're much better > off passing a File object rather than a FileInputStream - the File > constructor is much more memory efficient than the InputStream one > > (Ideally at some point we'll switch everything to using NPOIFS, but for > now NPOIFS lacks write support and there's no volunteer energy to finish > that last bit off) > > > Nick > > ------------------------------**------------------------------**--------- > To unsubscribe, e-mail: > [email protected].**org<[email protected]> > For additional commands, e-mail: [email protected] > >
