RobotsTXTSpideredErrorEvent.java
上传用户:qing5858
上传日期:2015-10-27
资源大小:6056k
文件大小:1k
源码类别:
搜索引擎
开发平台:
Java
- package net.javacoding.jspider.core.event.impl;
- import net.javacoding.jspider.core.SpiderContext;
- import net.javacoding.jspider.core.event.CoreEventVisitor;
- import net.javacoding.jspider.api.model.HTTPHeader;
- import java.net.URL;
- import java.net.URLConnection;
- /**
- *
- * $Id: RobotsTXTSpideredErrorEvent.java,v 1.3 2003/04/01 19:44:36 vanrogu Exp $
- *
- * @author G黱ther Van Roey
- */
- public class RobotsTXTSpideredErrorEvent extends URLSpideredErrorEvent {
- protected URL robotsTXTURL;
- public RobotsTXTSpideredErrorEvent(URL robotsTXTURL, SpiderContext context, URL url, int httpStatus, URLConnection urlConnection, HTTPHeader[] headers, Exception error) {
- super(context, url, httpStatus,urlConnection, headers, error );
- this.robotsTXTURL = robotsTXTURL;
- }
- public String toString() {
- return "robots.txt spidered : " + url + " ERROR : " + error.getClass() + ((httpStatus != 0) ? " (HTTP Status: " + httpStatus + ")" : "");
- }
- public void accept(URL url, CoreEventVisitor visitor) {
- visitor.visit(url, this);
- }
- public URL getRobotsTXTURL(){
- return robotsTXTURL;
- }
- }