public class SpiderDetector extends Object
| Constructor and Description |
|---|
SpiderDetector() |
| Modifier and Type | Method and Description |
|---|---|
static Set<String> |
getSpiderIpAddresses()
Get an immutable Set representing all the Spider Addresses here
|
static boolean |
isSpider(javax.servlet.http.HttpServletRequest request)
Static Service Method for testing spiders against existing spider files.
|
static boolean |
isSpider(String ip)
Check individual IP is a spider.
|
static boolean |
isSpider(String clientIP,
String proxyIPs,
String hostname,
String agent)
Static Service Method for testing spiders against existing spider files.
|
static Set<String> |
readPatterns(File patternFile)
Utility method which reads lines from a file & returns them in a Set.
|
public static Set<String> getSpiderIpAddresses()
public static Set<String> readPatterns(File patternFile) throws IOException
patternFile - the location of our spider fileIOException - could not happen since we check the file be4 we use itpublic static boolean isSpider(String clientIP, String proxyIPs, String hostname, String agent)
In future spiders HashSet may be optimized as byte offset array to improve performance and memory footprint further.
clientIP - address of the client.proxyIPs - comma-list of X-Forwarded-For addresses, or null.hostname - domain name of host, or null.agent - User-Agent header value, or null.public static boolean isSpider(javax.servlet.http.HttpServletRequest request)
request - public static boolean isSpider(String ip)
ip - Copyright © 2022 LYRASIS. All rights reserved.