Examples of MetExtractorProductCrawler


Examples of org.apache.oodt.cas.crawl.MetExtractorProductCrawler

* </p>.
*/
public final class TestBooleanOptions extends TestCase {

    public void testSetBooleanOptions() {
        MetExtractorProductCrawler crawler = new MetExtractorProductCrawler();
        try {
            crawler.getClass().getMethod("setNoRecur",
                    new Class[] { boolean.class }).invoke(crawler,
                    new Object[] { new Boolean(true) });
        } catch (Exception e) {
            fail(e.getMessage());
        }

        try {
            crawler.getClass().getMethod("setCrawlForDirs",
                    new Class[] { boolean.class }).invoke(crawler,
                    new Object[] { new Boolean(true) });
        } catch (Exception e) {
            fail(e.getMessage());
        }

        assertTrue(crawler.isNoRecur());
        assertTrue(crawler.isCrawlForDirs());

    }
View Full Code Here

Examples of org.apache.oodt.cas.crawl.MetExtractorProductCrawler

    // ingestActionDeleteDataFile - crawler post-ingest action
    // ingestionRootPath - prepend /data/ingest to this for full path
    //
    //

    MetExtractorProductCrawler casCrawler = this
        .configureCrawler(getServletContext().getInitParameter(
            FM_URL));
    casCrawler.setActionIds(Arrays.asList(req
        .getParameterValues("ingestAction")));
    String productRootPath = "/data/ingest/"
        + req.getParameter("ingestionRootPath");
    casCrawler.setProductPath(productRootPath);
    try {
      casCrawler.setMetExtractor(req.getParameter("metext"));
    } catch (Exception e) {
      throw new ServletException(e.getMessage());
    }

    try {
    casCrawler
      .setMetExtractorConfig(req.getParameter("metextConfigFilePath"));
  } catch (MetExtractionException e) {
    throw new ServletException(e.getMessage());
  }

    // turn em' loose
    casCrawler.crawl();
   
    // now we should explicitly destroy various sessions for cleanup
    HttpSession session = req.getSession();
    session.removeAttribute("metextPrettyName");
    session.removeAttribute("metext");
View Full Code Here

Examples of org.apache.oodt.cas.crawl.MetExtractorProductCrawler

    dispatcher.forward(req, res);
  }

  private MetExtractorProductCrawler configureCrawler(String ecasUrlStr)
      throws MalformedURLException {
    MetExtractorProductCrawler crawler = new MetExtractorProductCrawler();
    crawler
        .setClientTransferer(DEFAULT_TRANSFER_FACTORY);
    crawler.setApplicationContext(new FileSystemXmlApplicationContext(CRAWLER_CONF_FILE));
    crawler.setCrawlForDirs(false);
    crawler.setFilemgrUrl(ecasUrlStr);
    crawler.setNoRecur(false);
    return crawler;
  }
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.