1 36 37 package com.bluecubs.xinco.index.filetypes; 38 39 import java.io.File ; 40 import java.io.FileInputStream ; 41 import java.io.Reader ; 42 import org.textmining.text.extraction.WordExtractor; 43 44 public class XincoIndexMicrosoftWord implements XincoIndexFileType { 45 46 public XincoIndexMicrosoftWord() { 47 super(); 48 } 49 50 public Reader getFileContentReader(File f) { 51 return null; 52 } 53 54 public String getFileContentString(File f) { 55 String word_string = null; 56 FileInputStream is =null; 57 try { 58 is = new FileInputStream (f); 59 WordExtractor extractor = new WordExtractor(); 60 word_string = extractor.extractText(is); 61 is.close(); 62 } catch (Exception fe) { 63 word_string = null; 64 if (is != null) { 65 try { 66 is.close(); 67 } catch (Exception ise) {} 68 } 69 } 70 return word_string; 71 } 72 73 } 74 | Popular Tags |