Package net.sf.clairv.index.builder

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


    int dot = name.lastIndexOf('.');
    if (dot > 0) {
      String ext = name.substring(dot + 1);
      String clazz = extensionMappings.getProperty(ext);
      if (clazz != null) {
        DocumentBuilder db = (DocumentBuilder)builders.get(clazz);
        if (db == null) {
          try {
            db = (DocumentBuilder) Class.forName(clazz).newInstance();
            return db;
          } catch (Exception e) {
View Full Code Here


   *            normal file; should not be directory
   * @return ready-to-index document
   */
  protected Document processFile(File file, DocumentFactory docFactory) {
    if (file.isFile()) {
      DocumentBuilder builder = fileHandler.handle(file);
      if (builder == null) {
        log.debug("File " + file.getPath()
            + " cannot be recognized; ignored");
        return null;
      }
      try {
        FileInputStream fis = new FileInputStream(file);
        log.debug("Building document from file: "
            + file.getAbsolutePath());
        Document doc = docFactory.createDocument();
        builder.buildDocument(fis, doc);
        return doc;
      } catch (FileNotFoundException e) {
        log.error("File in use or not found");
        return null;
      } catch (DocumentHandlerException e) {
View Full Code Here

TOP

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

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.