KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > net > javacoding > jspider > core > event > impl > RobotsTXTUnexistingEvent


1 package net.javacoding.jspider.core.event.impl;
2
3
4 import net.javacoding.jspider.core.SpiderContext;
5 import net.javacoding.jspider.core.event.CoreEventVisitor;
6 import net.javacoding.jspider.api.model.HTTPHeader;
7
8 import java.net.URL JavaDoc;
9 import java.net.URLConnection JavaDoc;
10
11
12 /**
13  *
14  * $Id: RobotsTXTUnexistingEvent.java,v 1.3 2003/04/01 19:44:37 vanrogu Exp $
15  *
16  * @author Günther Van Roey
17  */

18 public class RobotsTXTUnexistingEvent extends URLSpideredErrorEvent {
19
20     protected URL JavaDoc robotsTXTURL;
21
22     public RobotsTXTUnexistingEvent(URL JavaDoc robotsTXTURL, SpiderContext context, URL JavaDoc url, int httpStatus, URLConnection JavaDoc urlConnection, HTTPHeader[] headers, Exception JavaDoc error) {
23         super(context, url, httpStatus, urlConnection, headers, error );
24         this.robotsTXTURL = robotsTXTURL;
25     }
26
27     public String JavaDoc toString() {
28         return "robots.txt spidered : " + url + " ERROR : " + error.getClass() + ((httpStatus != 0) ? " (HTTP Status: " + httpStatus + ")" : "");
29     }
30
31     public void accept(URL JavaDoc url, CoreEventVisitor visitor) {
32         visitor.visit(url, this);
33     }
34
35     public URL JavaDoc getRobotsTXTURL(){
36         return robotsTXTURL;
37     }
38
39 }
40
Popular Tags