net.sourceforge.wopa
类 AbstractDownloader

java.lang.Object
  继承者 net.sourceforge.wopa.AbstractDownloader
所有已实现的接口:
Downloader
直接已知子类:
PictureDownloader

public abstract class AbstractDownloader
extends java.lang.Object
implements Downloader

抽象的下载器

作者:
Li Rui

字段摘要
protected  DownloadConfig config
           
private  FixedThreadPool thread_pool
           
 
构造函数摘要
AbstractDownloader()
           
 
方法摘要
 void download()
          下载指定url的内容
private  void download(java.lang.String url, int lvl)
          下载指定url的子url所包含的内容,需要指定下载的层级
private  java.util.ArrayList<LinkFilter> getLinkFilterList()
          通过DownloadConfig.getLinkFilterConfig()获取的配置信息创建LinkFilterList
abstract  Saver getSaver(org.htmlparser.Node node, SaverConfig saverConfig)
          获取保存器
private  java.util.ArrayList<TagFilter> getTagFilterList()
          通过DownloadConfig.getTagFilterConfig()获取的配置信息创建TagFilterList
private  org.htmlparser.util.NodeList parse(org.htmlparser.util.NodeList list, java.util.ArrayList<? extends org.htmlparser.NodeFilter> filters)
          parse the specified NodeList by the given NodeFilters
 void setDownloadConfig(DownloadConfig config)
          设定下载配置
 void stop()
          停止程序
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

thread_pool

private FixedThreadPool thread_pool

config

protected DownloadConfig config
构造函数详细信息

AbstractDownloader

public AbstractDownloader()
方法详细信息

setDownloadConfig

public void setDownloadConfig(DownloadConfig config)
设定下载配置

指定者:
接口 Downloader 中的 setDownloadConfig

getSaver

public abstract Saver getSaver(org.htmlparser.Node node,
                               SaverConfig saverConfig)
获取保存器

返回:

download

public void download()
下载指定url的内容

指定者:
接口 Downloader 中的 download
参数:
url -

download

private void download(java.lang.String url,
                      int lvl)
下载指定url的子url所包含的内容,需要指定下载的层级

参数:
lvl - 层级,默认是0

stop

public void stop()
停止程序

指定者:
接口 Downloader 中的 stop

getLinkFilterList

private java.util.ArrayList<LinkFilter> getLinkFilterList()
通过DownloadConfig.getLinkFilterConfig()获取的配置信息创建LinkFilterList

返回:
一个创建好的LinkFilterList

getTagFilterList

private java.util.ArrayList<TagFilter> getTagFilterList()
通过DownloadConfig.getTagFilterConfig()获取的配置信息创建TagFilterList

返回:
一个创建好的TagFilterList

parse

private org.htmlparser.util.NodeList parse(org.htmlparser.util.NodeList list,
                                           java.util.ArrayList<? extends org.htmlparser.NodeFilter> filters)
parse the specified NodeList by the given NodeFilters

参数:
list -
filters -
返回: