• Post Reply Bookmark Topic Watch Topic
  • New Topic

java.lang.IllegalArgumentException: The document is really a RTF file  RSS feed

 
Farakh khan
Ranch Hand
Posts: 833
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,



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?

Thanks in anticipation
 
Paul Clapham
Sheriff
Posts: 22215
38
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!