users@jsr311.java.net

RE: JAX-RS: UriBuilder encoding

From: Manger, James H <James.H.Manger_at_team.telstra.com>
Date: Thu, 24 Jul 2008 13:39:49 +1000

> rename the segments parameter … to make it clear that each value is a path

Good idea.
I would scrap the varargs bit for paths, but support varargs for segments.
  path(String… path) -> path(String… path)
  replacePath(String… path) -> replacePath(String path) -or-> root().path(p)
It is a bit simpler (to understand & write correct code) when you don’t have ‘/’s coming from content and varargs simultaneously. I highly doubt it will add any “boilerplate” to code. ub.segment(s1, s2, s3) is available; as is ub.path(p1).path(p2) if necessary.


replaceMatrixParams should get the same sort of modifications as replaceQueryParams (eg change to matrix(String) and query(String)).

James Manger