public class UserAgentDirectives extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
UserAgentDirectives.UserAgentComparator |
| Modifier and Type | Field and Description |
|---|---|
static org.slf4j.Logger |
logger |
Set<String> |
userAgents |
| Constructor and Description |
|---|
UserAgentDirectives(Set<String> userAgents)
Create a UserAgentDirectives clause
|
| Modifier and Type | Method and Description |
|---|---|
void |
add(String rule,
String value)
Add a rule to the list of rules for this user agent.
|
int |
checkAccess(String path,
String userAgent) |
Double |
getCrawlDelay()
Return the configured crawl delay in seconds
|
String |
getPreferredHost()
Return the specified preferred host name in robots.txt.
|
List<String> |
getSitemap()
Return the listed sitemaps, or null if none was specified
|
boolean |
isEmpty() |
boolean |
isWildcard() |
int |
match(String userAgent)
Match the current user agent directive set with the given
user agent.
|
public int match(String userAgent)
userAgent - The user agent used by the crawlerpublic boolean isWildcard()
public boolean isEmpty()
public void add(String rule, String value)
rule - The name of the rulevalue - The value of the rulepublic Double getCrawlDelay()
public String getPreferredHost()
Copyright © 2017. All rights reserved.