@Test public void host() throws Exception { Url url = Urls.http("host").create(); assertEquals("host", url.host().display()); url = Urls.http("10.10.0.1:9000").create(); assertEquals("10.10.0.1", url.host().display()); url = Urls.http("2001:0db8:0000:0000:0000:8a2e:0370:7334").create(); assertEquals("2001:db8::8a2e:370:7334", url.host().display()); url = Urls.http("[2001:db8::8a2e:370:7334]").create(); assertEquals("2001:db8::8a2e:370:7334", url.host().display()); url = Urls.http("[::A]:9000").create(); assertEquals("::a", url.host().display()); assertEquals(9000, url.port()); }
public static UrlBuilder http(String host) { return new UrlBuilder(Scheme.HTTP, host); }
Urls { public static UrlBuilder http(String host) { return new UrlBuilder(Scheme.HTTP, host); } }
Urls { public static UrlBuilder http(String host) { return new UrlBuilder(Scheme.HTTP, host); } private  Urls(); }
Urls { public static UrlBuilder http(String host) { return new UrlBuilder(Scheme.HTTP, host); } private  Urls(); @Nonnull static URI createURI(@Nonnull String fullUrl); @Nonnull static String escape(@Nonnull String url); static UrlBuilder http(String host); static UrlBuilder https(String host); @Nonnull static Url parse(String url); }
Urls { public static UrlBuilder http(String host) { return new UrlBuilder(Scheme.HTTP, host); } private  Urls(); @Nonnull static URI createURI(@Nonnull String fullUrl); @Nonnull static String escape(@Nonnull String url); static UrlBuilder http(String host); static UrlBuilder https(String host); @Nonnull static Url parse(String url);  }