Package org.dspace.statistics.util
Class SpiderDetector
java.lang.Object
org.dspace.statistics.util.SpiderDetector
SpiderDetector delegates static methods to SpiderDetectorService,
which is used to find IPs, hosts, or agents that are spiders...
- Author:
- kevinvandevelde at atmire.com, ben at atmire.com, Mark Diggory (mdiggory at atmire.com), frederic at atmire.com
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanisSpider(jakarta.servlet.http.HttpServletRequest request) Static Service Method for testing spiders against existing spider files.static booleanCheck individual IP is a spider.static booleanStatic Service Method for testing spiders against existing spider files.readPatterns(File patternFile) Utility method which reads lines from a file & returns them in a Set.
-
Method Details
-
readPatterns
Utility method which reads lines from a file & returns them in a Set.- Parameters:
patternFile- the location of our spider file- Returns:
- a vector full of patterns
- Throws:
IOException- could not happen since we check the file be4 we use it
-
isSpider
Static Service Method for testing spiders against existing spider files.In future spiders HashSet may be optimized as byte offset array to improve performance and memory footprint further.
- Parameters:
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.- Returns:
- true if the client matches any spider characteristics list.
-
isSpider
public static boolean isSpider(jakarta.servlet.http.HttpServletRequest request) Static Service Method for testing spiders against existing spider files.- Parameters:
request-- Returns:
- true|false if the request was detected to be from a spider.
-
isSpider
Check individual IP is a spider.- Parameters:
ip-- Returns:
- if is spider IP
-