jsr339-experts@jax-rs-spec.java.net

[jsr339-experts] UriBuilder.segment and build with encodePathSlash

From: Sergey Beryozkin <sberyozkin_at_talend.com>
Date: Mon, 22 Oct 2012 12:26:45 +0100

I know that I'm the last one who still does not get it :-).

Consider the following:

uriBuilder.fromPath("http://localhost").segment("{a}").build("a/b", false);

UriBuilder.segment() states that "/" have to be encoded.
So one possible output is:

"http://localhost/a%2Fb"

While build() requires this slash to be left as is.

So the result is then:

"http://localhost/a/b"

If the last output is the right one (has to be really), then I guess

UriBuilder.segment() docs can be improved a bit to state that only "/"
in the literal expressions have to be encoded by default, otherwise the
encoding is affected by the new build flag, similarly the same
clarification needs to be applied to UriBuilder path docs

Sergey