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 ; 9 import java.net.URLConnection ; 10 11 12 18 public class RobotsTXTSpideredOkEvent extends URLSpideredOkEvent { 19 20 protected URL robotsTXTURL; 21 22 public RobotsTXTSpideredOkEvent(URL robotsTXTURL,SpiderContext context, URL url, int httpStatus, URLConnection urlConnection, String 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 toString() { 32 return "robots.txt spidered : " + url + " (" + httpStatus + "," + mimeType + "," + timeMs + " ms," + size + " bytes )"; 33 } 34 35 public void accept(URL url, CoreEventVisitor visitor) { 36 visitor.visit(url, this); 37 } 38 39 public URL getRobotsTXTURL(){ 40 return robotsTXTURL; 41 } 42 43 } 44 | Popular Tags |