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