reader = new InputStreamReader(is);
file = File.createTempFile("extract", ".tmp");
tempFiles.markForDeletion(file);
writer = new FileWriter(file);
DefaultStyledDocument doc = new DefaultStyledDocument();
new RTFEditorKit().read(reader, doc, 0);
writer.write(doc.getText(0, doc.getLength()));
} catch (Exception ioe) {
throw new ExtractionException("failed to parse rtf document", ioe,logger);
}
finally {