
net.vidageek.crawler.component.DefaultLinkNormalizer Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of crawler Show documentation
Show all versions of crawler Show documentation
Simple and extensible crawler.
The newest version!
package net.vidageek.crawler.component;
/**
* @author jonasabreu
*/
public class DefaultLinkNormalizer implements LinkNormalizer {
private final String beginUrl;
public DefaultLinkNormalizer(final String beginUrl) {
if ((beginUrl == null) || (beginUrl.trim().length() == 0)) {
throw new IllegalArgumentException("beginUrl cannot be null or empty");
}
this.beginUrl = beginUrl;
}
public String normalize(String url) {
url = url.replaceAll("&", "&");
return UrlUtils.resolveUrl(beginUrl, url);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy