public class HostDirectives extends Object
| Modifier and Type | Field and Description |
|---|---|
static int |
ALLOWED |
static int |
DISALLOWED |
static int |
UNDEFINED |
| Constructor and Description |
|---|
HostDirectives(RobotstxtConfig configuration) |
| Modifier and Type | Method and Description |
|---|---|
void |
addDirectives(UserAgentDirectives directives)
Store set of directives
|
boolean |
allows(String path)
Check if the host directives allows visiting path.
|
int |
checkAccess(String path)
Check if any of the rules say anything about the specified path
|
boolean |
disallows(String path)
Check if the host directives explicitly disallow visiting path.
|
long |
getLastAccessTime() |
boolean |
needsRefetch() |
void |
setUserAgent(String userAgent)
Change the user agent string used to crawl after initialization.
|
public static final int ALLOWED
public static final int DISALLOWED
public static final int UNDEFINED
public HostDirectives(RobotstxtConfig configuration)
public boolean needsRefetch()
public boolean allows(String path)
path - The path to checkpublic void setUserAgent(String userAgent)
userAgent - The new user agent to use.public boolean disallows(String path)
path - The path to checkpublic int checkAccess(String path)
path - The path to checkpublic void addDirectives(UserAgentDirectives directives)
directives - The set of directives to add to this hostpublic long getLastAccessTime()
Copyright © 2017. All rights reserved.