public void getDocument(String ifile, IndexableDoc doc)
{
String bodyText = null;
try
{ logger.info("Using POI classes to extract text from Word document: " + ifile);
WordDocument wd = new WordDocument( new FileInputStream( new File(ifile) ) );
StringWriter docTextWriter = new StringWriter();
wd.writeAllText(new PrintWriter(docTextWriter));
docTextWriter.close();
//*-- if no text was extracted, try antiword
bodyText = docTextWriter.toString(); bodyText = StringTools.filterChars(bodyText);
if (bodyText.length() == 0) bodyText = tryAntiword(ifile);