Bug 56800

Summary: Exception for XLSB files should indicate that the file format is unsupported
Product: POI Reporter: Niggler <nirk.niggler>
Component: XSSFAssignee: POI Developers List <dev>
Status: RESOLVED FIXED    
Severity: normal    
Priority: P2    
Version: 3.11-dev   
Target Milestone: ---   
Hardware: PC   
OS: All   

Description Niggler 2014-08-01 01:55:11 UTC
XLSB files are unlikely to be supported, and the exception probably should give some indication that the file is not in a supported format.

There appear to be a few ways to determine whether a file is XLSB (as opposed to XLSX or XLSM):

1) XLSB content types:

- workbook application/vnd.ms-excel.sheet.binary.macroEnabled.main
- sharedStrings application/vnd.ms-excel.sharedStrings
- worksheet application/vnd.ms-excel.worksheet
- styles application/vnd.ms-excel.styles

2) File extension: ".bin" for the workbook or worksheets is a good sign of an XLSB file.

Looking at other open source projects:

- python XLRD https://github.com/python-excel/xlrd raises an error if xl/workbook.bin is a file in the package

- javascript js-xlsx https://github.com/SheetJS/js-xlsx runs XLSB parsers if the relevant files end with ".bin"

- libreoffice has some information available at https://github.com/LibreOffice/core/blob/master/oox/source/dump/xlsbdumper.ini
Comment 1 Nick Burch 2014-08-01 14:35:04 UTC
As of r1615118, we now throw XLSBUnsupportedException, which extends from UnsupportedFileFormatException