String host = System.getProperty("host", "localhost");
String port = System.getProperty("port", "8080");
URI uri = UriBuilder.fromUri("http://{host}:{port}/examples")
        .path("123")
        .queryParam("sort", "name")
        .build(host, port);

 

Sonuç URI  =http://localhost:8080/examples/123?sort=name,