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

搜索引擎

开发平台:

Java

  1. package net.javacoding.jspider.core.event.impl;
  2. import net.javacoding.jspider.core.SpiderContext;
  3. import net.javacoding.jspider.core.event.CoreEventVisitor;
  4. import net.javacoding.jspider.api.model.HTTPHeader;
  5. import java.net.URL;
  6. import java.net.URLConnection;
  7. /**
  8.  *
  9.  * $Id: RobotsTXTSpideredErrorEvent.java,v 1.3 2003/04/01 19:44:36 vanrogu Exp $
  10.  *
  11.  * @author G黱ther Van Roey
  12.  */
  13. public class RobotsTXTSpideredErrorEvent extends URLSpideredErrorEvent {
  14.     protected URL robotsTXTURL;
  15.     public RobotsTXTSpideredErrorEvent(URL robotsTXTURL, SpiderContext context, URL url, int httpStatus, URLConnection urlConnection, HTTPHeader[] headers, Exception error) {
  16.         super(context, url, httpStatus,urlConnection, headers, error );
  17.         this.robotsTXTURL = robotsTXTURL;
  18.    }
  19.     public String toString() {
  20.         return "robots.txt spidered : " + url + " ERROR : " + error.getClass() + ((httpStatus != 0) ? " (HTTP Status: " + httpStatus + ")" : "");
  21.     }
  22.     public void accept(URL url, CoreEventVisitor visitor) {
  23.         visitor.visit(url, this);
  24.     }
  25.     public URL getRobotsTXTURL(){
  26.         return robotsTXTURL;
  27.     }
  28. }