All Downloads are FREE. Search and download functionalities are using the official Maven repository.

ai.platon.pulsar.skeleton.crawl.protocol.RobotRules.kt Maven / Gradle / Ivy

There is a newer version: 2.1.0
Show newest version
package ai.platon.pulsar.skeleton.crawl.protocol

import java.net.URL

/**
 * This class holds the rules which were parsed from a robots.txt file, and can
 * test paths against those rules.
 */
interface RobotRules {
    /**
     * Get expire time
     */
    val expireTime: Long

    /**
     * Get Crawl-Delay, in milliseconds. This returns -1 if not set.
     */
    val crawlDelay: Long

    /**
     * Returns `false` if the `robots.txt` file prohibits us
     * from accessing the given `url`, or `true` otherwise.
     */
    fun isAllowed(url: URL): Boolean
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy