Package com.norconex.crawler.web.util
Class Web
java.lang.Object
com.norconex.crawler.web.util.Web
-
Method Summary
Modifier and TypeMethodDescriptionstatic WebCrawlerConfigconfig(CrawlerContext crawlContext) static voidfireIfUrlOutOfScope(CrawlerSession crawlSession, WebCrawlerEntry docContext, UrlScope urlScope) static <T> CacheMap<T> gridCache(@NonNull CrawlerSession crawlSession, @NonNull String name, @NonNull Class<? extends T> type) static PropertiesparseDomAttributes(String attribsStr) Parses a string containing one or more HTML/XML attributes (e.g., key="value") and returns them all.static PropertiesparseDomAttributes(String attribsStr, boolean caseInsensitive) Parses a string containing one or more HTML/XML attributes (e.g., key="value") and returns them all.static RobotsTxtrobotsTxt(CrawlerContext crawler, String reference) static StringtrimAfterSubString(String wholeStr, String subStr) static StringtrimAroundSubString(String wholeStr, String subStr) static StringtrimBeforeSubString(String wholeStr, String subStr)
-
Method Details
-
gridCache
public static <T> CacheMap<T> gridCache(@NonNull @NonNull CrawlerSession crawlSession, @NonNull @NonNull String name, @NonNull @NonNull Class<? extends T> type) -
fireIfUrlOutOfScope
public static void fireIfUrlOutOfScope(CrawlerSession crawlSession, WebCrawlerEntry docContext, UrlScope urlScope) -
config
-
robotsTxt
-
trimAroundSubString
-
trimBeforeSubString
-
trimAfterSubString
-
parseDomAttributes
Parses a string containing one or more HTML/XML attributes (e.g., key="value") and returns them all. This method deals with attributes only but can also be passed actual HTML/XML mark-up. Given the latter, this method will only consider attributes of the first element encountered. No attempt is made to first create a DOM model, so the string argument does not have to be fully "valid" XML/HTML. If the attribute string isnullor produces no match, an emptyPropertiesis returned.- Parameters:
attribsStr- the string containing attributes- Returns:
- attributes (never
null)
-
parseDomAttributes
Parses a string containing one or more HTML/XML attributes (e.g., key="value") and returns them all. This method deals with attributes only but can also be passed actual HTML/XML mark-up. Given the latter, this method will only consider attributes of the first element encountered. No attempt is made to first create a DOM model, so the string argument does not have to be fully "valid" XML/HTML. If the attribute string isnullor produces no match, an emptyPropertiesis returned.- Parameters:
attribsStr- the string containing attributescaseInsensitive- whether the return properties has case-insensitive keys- Returns:
- attributes (never
null)
-