public class SpiderDetector
extends java.lang.Object
| Constructor and Description |
|---|
SpiderDetector() |
| Modifier and Type | Method and Description |
|---|---|
static java.util.Set<java.lang.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(java.lang.String ip)
Check individual IP is a spider.
|
static boolean |
isSpider(java.lang.String clientIP,
java.lang.String proxyIPs,
java.lang.String hostname,
java.lang.String agent)
Static Service Method for testing spiders against existing spider files.
|
static java.util.Set<java.lang.String> |
readPatterns(java.io.File patternFile)
Utility method which reads lines from a file & returns them in a Set.
|
public static java.util.Set<java.lang.String> readPatterns(java.io.File patternFile)
throws java.io.IOException
patternFile - the location of our spider filejava.io.IOException - could not happen since we check the file be4 we use itpublic static java.util.Set<java.lang.String> getSpiderIpAddresses()
public static boolean isSpider(java.lang.String clientIP,
java.lang.String proxyIPs,
java.lang.String hostname,
java.lang.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(java.lang.String ip)
ip - Copyright © 2018 DuraSpace. All Rights Reserved.