Deleting crawls

Call the IasCrawler.deleteCrawl() method to delete an existing crawl.

The syntax of the method is:

IasCrawler.deleteCrawl(CrawlId crawlId)

The crawlId parameter is a CrawlId object that contains the name of the crawl to be deleted.

Note: You cannot delete a crawl that is running.

To delete a crawl:

  1. Make sure that you have created a connection to the IAS Server. (An IasCrawler object named crawler is used in this example.)
  2. Set the name for the crawl to be deleted by first instantiating a CrawlId object and then setting Id in the constructor.
    For example:
    // Create a new crawl Id with the name set to Demo.
    CrawlId crawlId = new CrawlId("Demo");
  3. Call the IasCrawler.deleteCrawl() method with the CrawlId object. To catch exceptions, use a try block with the appropriate catch clauses, as in this example:
    try {
       crawler.deleteCrawl(crawlId);
    }
    catch (CrawlNotFoundException e) {
       System.out.println(e.getLocalizedMessage());
    }
If the IasCrawler.deleteCrawl() method fails, it throws an exception:
  • CrawlInProgressException occurs if the crawl is running.
  • CrawlNotFoundException occurs if the specified crawl (the crawlId parameter) does not exist or is otherwise not found.
  • EidiException occurs if a problem is encountered that prevents the crawl from being deleted.