KickJava   Java API By Example, From Geeks To Geeks.

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


1 package net.javacoding.jspider.core.event.impl;
2
3
4 import net.javacoding.jspider.api.model.HTTPHeader;
5 import net.javacoding.jspider.core.SpiderContext;
6 import net.javacoding.jspider.core.event.CoreEventVisitor;
7
8 import java.net.URL JavaDoc;
9 import java.net.URLConnection JavaDoc;
10
11
12 /**
13  *
14  * $$
15  *
16  * @author Günther Van Roey
17  */

18 public class RobotsTXTSpideredOkEvent extends URLSpideredOkEvent {
19
20     protected URL JavaDoc robotsTXTURL;
21
22     public RobotsTXTSpideredOkEvent(URL JavaDoc robotsTXTURL,SpiderContext context, URL JavaDoc url, int httpStatus, URLConnection JavaDoc urlConnection, String JavaDoc mimeType, int timeMs, int size, byte[] bytes, HTTPHeader[] headers) {
23         super(context,url, httpStatus, urlConnection, mimeType, timeMs, size, bytes, headers);
24         this.robotsTXTURL = robotsTXTURL;
25     }
26
27     public byte[] getBytes() {
28         return bytes;
29     }
30
31     public String JavaDoc toString() {
32         return "robots.txt spidered : " + url + " (" + httpStatus + "," + mimeType + "," + timeMs + " ms," + size + " bytes )";
33     }
34
35     public void accept(URL JavaDoc url, CoreEventVisitor visitor) {
36         visitor.visit(url, this);
37     }
38
39     public URL JavaDoc getRobotsTXTURL(){
40         return robotsTXTURL;
41     }
42
43 }
44
Popular Tags