Class DefaultCrawlScope

  • All Implemented Interfaces:
    CrawlScope

    public class DefaultCrawlScope
    extends Object
    implements CrawlScope
    A CrawlScope that allows to crawl only under a given domain.
    Since:
    5.0
    • Field Detail

      • url

        private URI url
    • Constructor Detail

      • DefaultCrawlScope

        public DefaultCrawlScope​(URI url)
        Constructs a DefaultCrawlScope with the given URL.
        Parameters:
        url - the URL with allowed domain, must not be null.
    • Method Detail

      • getUrl

        public URI getUrl()
        Gets the URL used for scope check.
        Returns:
        the URL used for scope check.
      • isInScope

        public boolean isInScope​(String url)
        Description copied from interface: CrawlScope
        Tells whether or not the given URL is in scope.

        Called during the crawl process, to know if the crawling process should crawl or backtrack.

        Specified by:
        isInScope in interface CrawlScope
        Parameters:
        url - the URL to check if it's in scope.
        Returns:
        true if the given URL is in scope, false otherwise.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object