RobotsTXTSpideredOkEvent.java
上传用户:qing5858
上传日期:2015-10-27
资源大小:6056k
文件大小:1k
源码类别:

搜索引擎

开发平台:

Java

  1. package net.javacoding.jspider.core.event.impl;
  2. import net.javacoding.jspider.api.model.HTTPHeader;
  3. import net.javacoding.jspider.core.SpiderContext;
  4. import net.javacoding.jspider.core.event.CoreEventVisitor;
  5. import java.net.URL;
  6. import java.net.URLConnection;
  7. /**
  8.  *
  9.  * $$
  10.  *
  11.  * @author G黱ther Van Roey
  12.  */
  13. public class RobotsTXTSpideredOkEvent extends URLSpideredOkEvent {
  14.     protected URL robotsTXTURL;
  15.     public RobotsTXTSpideredOkEvent(URL robotsTXTURL,SpiderContext context, URL url, int httpStatus, URLConnection urlConnection, String mimeType, int timeMs, int size, byte[] bytes, HTTPHeader[] headers) {
  16.         super(context,url, httpStatus, urlConnection, mimeType, timeMs, size, bytes, headers);
  17.         this.robotsTXTURL = robotsTXTURL;
  18.     }
  19.     public byte[] getBytes() {
  20.         return bytes;
  21.     }
  22.     public String toString() {
  23.         return "robots.txt spidered : " + url + " (" + httpStatus + "," + mimeType + "," + timeMs + " ms," + size + " bytes )";
  24.     }
  25.     public void accept(URL url, CoreEventVisitor visitor) {
  26.         visitor.visit(url, this);
  27.     }
  28.     public URL getRobotsTXTURL(){
  29.         return robotsTXTURL;
  30.     }
  31. }