contextualurl.java

来自「一个网络爬虫」· Java 代码 · 共 82 行

JAVA
82
字号
package org.flaviotordini.arale;

import java.util.*;
import java.net.*;

/**
 *  Represents an URL with additional context information.
 *
 *@author     Flavio Tordini
 *@created    28 novembre 2001
 */
public class ContextualURL {

    /**
     *  the URL
     *
     *@since    28 novembre 2001
     */
    public URL url;

    /**
     *  the father URL
     *
     *@since    28 novembre 2001
     */
    public URL context;

    /**
     *  the number of domain changes since the "homepage"
     *
     *@since    28 novembre 2001
     */
    public int domainDepth;

    /**
     *  URL changed according to user settings. (mainly for dynamic files)
     */
    public URL transformedURL;

    /**
     *  url should be scanned for new links.
     */
    public boolean scannable;

    /**
     *  url should be downloaded to disk.
     */
    public boolean downloadable;

    /**
     *  url has to be transformed.
     */
    public boolean renamable;

    /**
     *  The string found on the referring resource
     */
    public String originalLink;

    /**
     *  Description of the Field
     */
    public String token;


    /**
     *  Constructor for the ContextualURL object
     *
     *@param  context      father url
     *@param  url          url
     *@param  domainDepth
     *@since               28 novembre 2001
     */
    public ContextualURL(URL context, URL url, int domainDepth) {
        this.context = context;
        this.url = url;
        this.domainDepth = domainDepth;
    }

}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?