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

Method getHostname

src/main/java/org/htmlunit/javascript/host/URL.java:210–217  ·  view source on GitHub ↗

@return the host, that is the hostname, and then, if the port of the URL is nonempty, a ':', followed by the port of the URL.

()

Source from the content-addressed store, hash-verified

208 * a ':', followed by the port of the URL.
209 */
210 @JsxGetter
211 public String getHostname() {
212 if (url_ == null) {
213 return null;
214 }
215
216 return UrlUtils.encodeAnchor(url_.getHost());
217 }
218
219 /**
220 * Sets the {@code hostname} property.

Callers

nothing calls this directly

Calls 2

encodeAnchorMethod · 0.95
getHostMethod · 0.45

Tested by

no test coverage detected