As useful as they are, I haven't found a way using the Apache POI classes to give me a way to tell if I have a DOCX (XML format) or
DOC (OLE format).
Thus, running the POI logic, you can get a particular document Exception if you're using the wrong POI classes for the
Word document format you're trying to read.
Relying on the file name extension might work most of the time, but a user could change the file extension from .DOCX -> .DOC or vice versa which wouldn't change the document format.
My question, then, is ... is it "bad form" to, say assume one document format, but if the document exception gets thrown, to then just call another method to use the correct classes?
This is a really a generic question: Is it allowable programming practice to use some exception to decide to run another method -- WHEN, for example in this case, I don't see how to determine the format of a Word document without first trying to, well, use it.
Thanks in advance,
-- mike