broadscope.java

来自「一个搜索引擎,希望对大家有用」· Java 代码 · 共 84 行

JAVA
84
字号
/* Copyright (C) 2003 Internet Archive. * * This file is part of the Heritrix web crawler (crawler.archive.org). * * Heritrix is free software; you can redistribute it and/or modify * it under the terms of the GNU Lesser Public License as published by * the Free Software Foundation; either version 2.1 of the License, or * any later version. * * Heritrix is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the * GNU Lesser Public License for more details. * * You should have received a copy of the GNU Lesser Public License * along with Heritrix; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA * * CrawlScope.java * Created on Oct 1, 2003 * * $Header: /cvsroot/archive-crawler/ArchiveOpenCrawler/src/java/org/archive/crawler/scope/BroadScope.java,v 1.18 2005/06/10 00:24:54 stack-sf Exp $ */package org.archive.crawler.scope;/** * A CrawlScope instance defines which URIs are "in" * a particular crawl. * * It is essentially a Filter which determines, looking at * the totality of information available about a * CandidateURI/CrawlURI instamce, if that URI should be * scheduled for crawling. * * <p>Dynamic information inherent in the discovery of the * URI -- such as the path by which it was discovered -- * may be considered. * * <p>Dynamic information which requires the consultation * of external and potentially volatile information -- * such as current robots.txt requests and the history * of attempts to crawl the same URI -- should NOT be * considered. Those potentially high-latency decisions * should be made at another step. . * * @author gojomo * */public class BroadScope extends ClassicScope {    /**     * Constructor.     *     * @param name Name of this crawlscope.     */    public BroadScope(String name) {        super(name);        setDescription("BroadScope: A scope for broad crawls. Crawls made" +        " with this scope will not be limited to the hosts or domains of" +        " its seeds. NOTE: BroadScoped crawls will eventually run out of" +        " memory (See Release Notes).");    }    /**     * @param o the URI to check.     * @return True if transitive filter accepts passed object.     */    protected boolean transitiveAccepts(Object o) {        return true;    }    /** Check if URI is accepted by the focus of this scope.     *     * This method should be overridden in subclasses.     *     * @param o the URI to check.     * @return True if focus filter accepts passed object.     */    protected boolean focusAccepts(Object o) {        return true;    }}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?