[jax-rs-spec users] [jsr339-experts] Response.fromUri methods

From: Sergey Beryozkin <>
Date: Tue, 7 Aug 2012 13:52:45 +0300

Hi All,

We now have UriBuilder.uri(URI uri) and UriBuilder.uri(String
uriTemplate) methods, and related UriBuilder.fromUri(URI uri)
and UriBuilder.fromUri(String uriTemplate).

In JAX-RS 1.1, we only had UriBuilder.fromUri(String uri) which leading
to UriBuilder.uri(URI uri) call.

Now UriBuilder.fromUri(String uri) leads to UriBuilder.uri(String
uritemplate) call which in itself is somewhat unexpected but I can agree
with it.

What do you think about adding another static method,
UriBuilder.fromUriTemplate(String uriTemplate) and a new
UriBuilder.uriTemplate(String uriTemplate) method ?

The end result:

UriBuilder.fromUri(URI uri) -> UriBuilder.uri(URI uri)
UriBuilder.fromUri(String uri) -> UriBuilder.uri(String uri)
UriBuilder.fromUriTemplate(String uriTemplate)

I think the implementation of UriBuilder.uri(String uri)
  can be more optimized if it's expected that the 'uri' is a valid URI,
as opposed to UriBuilder.fromUriTemplate(String uriTemplate), where a
different processing can take place