public class SimpleRobotRules extends BaseRobotRules
| Modifier and Type | Class and Description |
|---|---|
static class |
SimpleRobotRules.RobotRule
Single rule that maps from a path prefix to an allow flag.
|
static class |
SimpleRobotRules.RobotRulesMode |
| Modifier and Type | Field and Description |
|---|---|
protected SimpleRobotRules.RobotRulesMode |
_mode |
protected ArrayList<SimpleRobotRules.RobotRule> |
_rules |
UNSET_CRAWL_DELAY| Constructor and Description |
|---|
SimpleRobotRules() |
SimpleRobotRules(SimpleRobotRules.RobotRulesMode mode) |
| Modifier and Type | Method and Description |
|---|---|
void |
addRule(String prefix,
boolean allow) |
void |
clearRules() |
boolean |
equals(Object obj) |
List<SimpleRobotRules.RobotRule> |
getRobotRules() |
int |
hashCode() |
boolean |
isAllowAll()
Is our ruleset set up to allow all access?
|
boolean |
isAllowed(String url) |
boolean |
isAllowNone()
Is our ruleset set up to disallow all access?
|
void |
sortRules()
In order to match up with Google's convention, we want to match rules
from longest to shortest.
|
String |
toString()
Returns a string with the crawl delay as well as a list of sitemaps if
they exist (and aren't more than 10)
|
addSitemap, getCrawlDelay, getSitemaps, isDeferVisits, setCrawlDelay, setDeferVisitsprotected ArrayList<SimpleRobotRules.RobotRule> _rules
protected SimpleRobotRules.RobotRulesMode _mode
public SimpleRobotRules()
public SimpleRobotRules(SimpleRobotRules.RobotRulesMode mode)
public void clearRules()
public void addRule(String prefix, boolean allow)
public List<SimpleRobotRules.RobotRule> getRobotRules()
public boolean isAllowed(String url)
isAllowed in class BaseRobotRulespublic void sortRules()
public boolean isAllowAll()
isAllowAll in class BaseRobotRulespublic boolean isAllowNone()
isAllowNone in class BaseRobotRulespublic int hashCode()
hashCode in class BaseRobotRulespublic boolean equals(Object obj)
equals in class BaseRobotRulespublic String toString()
BaseRobotRulestoString in class BaseRobotRulesCopyright © 2009–2021 Crawler-Commons. All rights reserved.