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