@Test public void rebase() throws URISyntaxException { URI uri = new URI("https: URI base = new URI("http: URI rebased = URIUtil.rebase(uri, base); assertThat(rebased.toString()).isEqualTo("http: }
public static URI rebase(URI uri, URI base) throws URISyntaxException { if (base == null) { return uri; } String scheme = base.getScheme(); String host = base.getHost(); int port = base.getPort(); if (scheme == null || host == null) { return uri; } return create(scheme, uri.getRawUserInfo(), host, port, uri.getRawPath(), uri.getRawQuery(), uri.getRawFragment()); }
URIUtil { public static URI rebase(URI uri, URI base) throws URISyntaxException { if (base == null) { return uri; } String scheme = base.getScheme(); String host = base.getHost(); int port = base.getPort(); if (scheme == null || host == null) { return uri; } return create(scheme, uri.getRawUserInfo(), host, port, uri.getRawPath(), uri.getRawQuery(), uri.getRawFragment()); } }
URIUtil { public static URI rebase(URI uri, URI base) throws URISyntaxException { if (base == null) { return uri; } String scheme = base.getScheme(); String host = base.getHost(); int port = base.getPort(); if (scheme == null || host == null) { return uri; } return create(scheme, uri.getRawUserInfo(), host, port, uri.getRawPath(), uri.getRawQuery(), uri.getRawFragment()); } private  URIUtil(); }
URIUtil { public static URI rebase(URI uri, URI base) throws URISyntaxException { if (base == null) { return uri; } String scheme = base.getScheme(); String host = base.getHost(); int port = base.getPort(); if (scheme == null || host == null) { return uri; } return create(scheme, uri.getRawUserInfo(), host, port, uri.getRawPath(), uri.getRawQuery(), uri.getRawFragment()); } private  URIUtil(); static URI create(String scheme, String rawUserInfo, String host, int port,
    String rawPath, String rawQuery, String rawFragment); static URI rebase(URI uri, URI base); }
URIUtil { public static URI rebase(URI uri, URI base) throws URISyntaxException { if (base == null) { return uri; } String scheme = base.getScheme(); String host = base.getHost(); int port = base.getPort(); if (scheme == null || host == null) { return uri; } return create(scheme, uri.getRawUserInfo(), host, port, uri.getRawPath(), uri.getRawQuery(), uri.getRawFragment()); } private  URIUtil(); static URI create(String scheme, String rawUserInfo, String host, int port,
    String rawPath, String rawQuery, String rawFragment); static URI rebase(URI uri, URI base);  }