Well, I'm passing File into WorkbookFactory.create(). HSSF/XSSF workbook is
created depending on file contents (type).
But how can I force WorkbookFactory to always use NPOIFSFileSystem?

My code is:
 Workbook wb = WorkbookFactory.create(new FileInputStream(filename));


You see exception occurs only on some specific files. But everything works
fine in most cases.

Thanks!

2011/12/11 Nick Burch <[email protected]>

> On Sun, 11 Dec 2011, Ilia Ternovich wrote:
>
>> Thank you for answer. Are there any code samples avaliable of how to use
>> NPOIFSFileSystem and WorkbookFactory?
>>
>
> Largely just treat it like a POIFSFileSystem.
>
>  Currently WorkbookFactory.create() accepts only
>> POIFSFileSystem<http://poi.**apache.org/apidocs/org/apache/**
>> poi/poifs/filesystem/**POIFSFileSystem.html<http://poi.apache.org/apidocs/org/apache/poi/poifs/filesystem/POIFSFileSystem.html>
>> >
>>
>
> You don't need to use WorkbookFactory with a POIFSFileSystem - it can only
> ever be a HSSFWorkbook. It's most useful with a File or InputStream, where
> it could be either HSSF or XSSF
>
>
> Nick
>
> ------------------------------**------------------------------**---------
> To unsubscribe, e-mail: 
> [email protected].**org<[email protected]>
> For additional commands, e-mail: [email protected]
>
>

Reply via email to