01: package net.javacoding.jspider.core.event.impl;
02:
03: import net.javacoding.jspider.api.model.HTTPHeader;
04: import net.javacoding.jspider.core.SpiderContext;
05: import net.javacoding.jspider.core.event.CoreEventVisitor;
06:
07: import java.net.URL;
08: import java.net.URLConnection;
09:
10: /**
11: *
12: * $$
13: *
14: * @author Günther Van Roey
15: */
16: public class RobotsTXTSpideredOkEvent extends URLSpideredOkEvent {
17:
18: protected URL robotsTXTURL;
19:
20: public RobotsTXTSpideredOkEvent(URL robotsTXTURL,
21: SpiderContext context, URL url, int httpStatus,
22: URLConnection urlConnection, String mimeType, int timeMs,
23: int size, byte[] bytes, HTTPHeader[] headers) {
24: super (context, url, httpStatus, urlConnection, mimeType,
25: timeMs, size, bytes, headers);
26: this .robotsTXTURL = robotsTXTURL;
27: }
28:
29: public byte[] getBytes() {
30: return bytes;
31: }
32:
33: public String toString() {
34: return "robots.txt spidered : " + url + " (" + httpStatus + ","
35: + mimeType + "," + timeMs + " ms," + size + " bytes )";
36: }
37:
38: public void accept(URL url, CoreEventVisitor visitor) {
39: visitor.visit(url, this );
40: }
41:
42: public URL getRobotsTXTURL() {
43: return robotsTXTURL;
44: }
45:
46: }
|