MCPcopy Create free account
hub / github.com/HtmlUnit/htmlunit / getTargetUrl

Method getTargetUrl

src/main/java/org/htmlunit/html/HtmlAnchor.java:218–225  ·  view source on GitHub ↗

INTERNAL API - SUBJECT TO CHANGE AT ANY TIME - USE AT YOUR OWN RISK. @param href the href @param page the HtmlPage @return the calculated target url. @throws MalformedURLException if an IO error occurs

(final String href, final HtmlPage page)

Source from the content-addressed store, hash-verified

216 * @throws MalformedURLException if an IO error occurs
217 */
218 public static URL getTargetUrl(final String href, final HtmlPage page) throws MalformedURLException {
219 URL url = page.getFullyQualifiedUrl(href);
220 // fix for empty url
221 if (StringUtils.isEmptyOrNull(href)) {
222 url = UrlUtils.getUrlWithNewRef(url, null);
223 }
224 return url;
225 }
226
227 /**
228 * {@inheritDoc}

Callers 2

getDefaultValueMethod · 0.95
doClickStateUpdateMethod · 0.95

Calls 3

isEmptyOrNullMethod · 0.95
getUrlWithNewRefMethod · 0.95
getFullyQualifiedUrlMethod · 0.80

Tested by

no test coverage detected