Package net.sf.clairv.index.builder

Examples of net.sf.clairv.index.builder.DocumentHandlerException


    DefaultStyledDocument styledDoc = new DefaultStyledDocument();
    try {
      new RTFEditorKit().read(is, styledDoc, 0);
      bodyText = styledDoc.getText(0, styledDoc.getLength());
    } catch (IOException e) {
      throw new DocumentHandlerException(
          "Cannot extract text from a RTF document", e);
    } catch (BadLocationException e) {
      throw new DocumentHandlerException(
          "Cannot extract text from a RTF document", e);
    }

    if (bodyText != null) {
      doc.addField("body", bodyText, StoreOption.COMPRESS, IndexOption.TOKENIZED);
View Full Code Here


    try {
      PowerPointExtractor ppe = new PowerPointExtractor(is);
      bodyText = ppe.getText();
    } catch (Exception e) {
      throw new DocumentHandlerException(
          "Cannot extract text from a ppt document", e);
    }

    if ((bodyText != null) && (bodyText.trim().length() > 0)) {
      doc.addField("body", bodyText, StoreOption.COMPRESS,
View Full Code Here

      StringWriter sw = new StringWriter();
      wordDoc.writeAllText(sw);
      sw.close();
      bodyText = sw.toString();
    } catch (Exception e) {
      throw new DocumentHandlerException(
          "Cannot extract text from a Word document", e);
    }

    if ((bodyText != null) && (bodyText.trim().length() > 0)) {
      doc.addField("body", bodyText, StoreOption.COMPRESS, IndexOption.TOKENIZED);
    } else {
      throw new DocumentHandlerException("Doc file is empty");
    }
  }
View Full Code Here

      while ((line = br.readLine()) != null) {
        bodyText.append(line).append("\n");
      }
      br.close();
    } catch (IOException e) {
      throw new DocumentHandlerException("Cannot read the text document",
          e);
    }

    doc.addField("body", bodyText.toString(), StoreOption.COMPRESS,
        IndexOption.TOKENIZED);
View Full Code Here

TOP

Related Classes of net.sf.clairv.index.builder.DocumentHandlerException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.