Examples of DocumentHandlerException


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

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

    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

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

      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

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

      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

Examples of org.springmodules.lucene.index.DocumentHandlerException

*/
public abstract class SqlDocumentHandler extends AbstractDocumentHandler {

  private void checkDescriptionParameters(Map description) {
    if( description.get(SqlRequest.SQL_REQUEST)==null ) {
      throw new DocumentHandlerException("The parameter "+SqlRequest.SQL_REQUEST+
          " is required for this type of document handler");
    }
  }
View Full Code Here

Examples of org.springmodules.lucene.index.DocumentHandlerException

      DocumentMatching matching = (DocumentMatching)i.next();
      if( matching.match(name) ) {
        return (DocumentHandler)documentHandlers.get(matching);
      }
    }
    throw new DocumentHandlerException("No document handler defined for the name "+name);
  }
View Full Code Here

Examples of org.springmodules.lucene.index.DocumentHandlerException

  public final Document getDocument(Map description, Object object)
      throws Exception {
    if (supports(object.getClass())) {
      return doGetDocument(description, object);
    } else {
      throw new DocumentHandlerException(
          "The document handler does not support the class "
              + object.getClass());
    }
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.