java.lang.IllegalArgumentException: The document is really a RTF file
posted 3 years ago
My code read rtf, doc, docx and pdf files. The code works fine but sometime I am getting the following exception:
The message is very clear that rtf file is given instead of word file. When java.lang.IllegalArgumentException: The document is really a RTF file exception thrown then how can I redirect RTF file from readDocFile() to readRTF() method?
I'm not sure what you mean by "redirect". If you mean that you want to use some kind of resources which were produced by the readDocFile method instead of redoing that process in the readRTF method, don't bother with that. Just start over at the beginning and call the readRTF method as if you knew in the first place that you had an RTF file.