Examples of TikaConfig


Examples of org.apache.tika.config.TikaConfig

  }
 
  public TIKAWrapper(String configLocation) throws TikaException{
    if (configLocation!=null)
      try {
        config = new TikaConfig(configLocation);
      } catch (Exception e) {}
    if (config==null
    config = TikaConfig.getDefaultConfig();
  }
View Full Code Here

Examples of org.apache.tika.config.TikaConfig

    // initialise TIKA parser
    // try to get a custom config
    URL tikaConfigURL = null;
    try {
      tikaConfigURL = getContext().getResourceURL(tika_file_param);
      config = new TikaConfig(tikaConfigURL);
    } catch (Exception e1) {
      // to log
      System.err.println("Failed to load TIKA config file from "+tikaConfigURL);
      config = null;
    }
View Full Code Here

Examples of org.apache.tika.config.TikaConfig

    private URL u;

    private static final File f = new File("/a/b/c/x.pdf");

    protected void setUp() throws Exception{
        TikaConfig config = TikaConfig.getDefaultConfig();
        repo = config.getMimeRepository();
        tika = new Tika(config);
        u = new URL("http://mydomain.com/x.pdf?x=y");
    }
View Full Code Here

Examples of org.apache.tika.config.TikaConfig

        }
        if (url == null) {
            url = SearchIndex.class.getResource("tika-config.xml");
        }

        TikaConfig config = null;
        if (url != null) {
            try {
                config = new TikaConfig(url);
            } catch (Exception e) {
                log.warn("Tika configuration not available: " + url, e);
            }
        }
        if (config == null) {
View Full Code Here

Examples of org.apache.tika.config.TikaConfig

public class OOXMLParserTest extends TikaTest {
    private Parser parser;
  
    @Override
    protected void setUp() throws Exception {
       TikaConfig config = TikaConfig.getDefaultConfig();
       ContainerAwareDetector detector = new ContainerAwareDetector(
             config.getMimeRepository()
       );
       parser = new AutoDetectParser(detector);
    }
View Full Code Here

Examples of org.apache.tika.config.TikaConfig

        || (type != null && type.getName().equals(MimeTypes.OCTET_STREAM))) {
      // If no mime-type header, or cannot find a corresponding registered
      // mime-type, then guess a mime-type from the url pattern

      try {
        TikaConfig tikaConfig = TikaConfig.getDefaultConfig();
        Tika tika = new Tika(tikaConfig);
        retType = tika.detect(url) != null ? tika.detect(url) : null;
      } catch (Exception e) {
        String message = "Problem loading default Tika configuration";
        LOG.error(message, e);
View Full Code Here

Examples of org.apache.tika.config.TikaConfig

        }
        if (url == null) {
            url = SearchIndex.class.getResource("tika-config.xml");
        }

        TikaConfig config = null;
        if (url != null) {
            try {
                config = new TikaConfig(url);
            } catch (Exception e) {
                log.warn("Tika configuration not available: " + url, e);
            }
        }
        if (config == null) {
View Full Code Here

Examples of org.apache.tika.config.TikaConfig

    private URL u;

    private static final File f = new File("/a/b/c/x.pdf");

    protected void setUp() throws Exception{
        TikaConfig config = TikaConfig.getDefaultConfig();
        repo = config.getMimeRepository();
        tika = new Tika(config);
        u = new URL("http://mydomain.com/x.pdf?x=y");
    }
View Full Code Here

Examples of org.apache.tika.config.TikaConfig

         final InputStream is = configManager.getInputStream(params.getValueParam(TIKA_CONFIG_PATH).getValue());
         conf = SecurityHelper.doPrivilegedExceptionAction(new PrivilegedExceptionAction<TikaConfig>()
         {
            public TikaConfig run() throws Exception
            {
               return new TikaConfig(is);
            }
         });
      }
      else
      {
View Full Code Here

Examples of org.apache.tika.config.TikaConfig

        }
        if (url == null) {
            url = SearchIndex.class.getResource("tika-config.xml");
        }

        TikaConfig config = null;
        if (url != null) {
            try {
                config = new TikaConfig(url);
            } catch (Exception e) {
                log.warn("Tika configuration not available: " + url, e);
            }
        }
        if (config == null) {
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.