MCPcopy Create free account
hub / github.com/apache/nutch / putOutlink

Method putOutlink

src/java/org/apache/nutch/parse/ParseUtil.java:304–322  ·  view source on GitHub ↗
(WebPage page, Outlink outlink, String toUrl)

Source from the content-addressed store, hash-verified

302 }
303
304 private void putOutlink(WebPage page, Outlink outlink, String toUrl) {
305 try {
306 toUrl = normalizers.normalize(toUrl, URLNormalizers.SCOPE_OUTLINK);
307 toUrl = filters.filter(toUrl);
308 } catch (MalformedURLException e2) {
309 return;
310 } catch (URLFilterException e) {
311 return;
312 }
313 if (toUrl == null) {
314 return;
315 }
316 Utf8 utf8ToUrl = new Utf8(toUrl);
317 if (page.getOutlinks().get(utf8ToUrl) != null) {
318 // skip duplicate outlinks
319 return;
320 }
321 page.getOutlinks().put(utf8ToUrl, new Utf8(outlink.getAnchor()));
322 }
323
324 /**
325 * Parses given web page and stores parsed content within page. Puts a

Callers 1

processMethod · 0.95

Calls 6

normalizeMethod · 0.65
filterMethod · 0.65
getMethod · 0.65
getOutlinksMethod · 0.45
putMethod · 0.45
getAnchorMethod · 0.45

Tested by

no test coverage detected