Bug 56800 - Exception for XLSB files should indicate that the file format is unsupported
Summary: Exception for XLSB files should indicate that the file format is unsupported
Status: RESOLVED FIXED
Alias: None
Product: POI
Classification: Unclassified
Component: XSSF (show other bugs)
Version: 3.11-dev
Hardware: PC All
: P2 normal (vote)
Target Milestone: ---
Assignee: POI Developers List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-08-01 01:55 UTC by Niggler
Modified: 2014-08-01 14:35 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
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