users@jersey.java.net

Re: [Jersey] UriBuilder.fromResource(Something.class) absolute

From: Paul Sandoz <Paul.Sandoz_at_oracle.com>
Date: Thu, 12 Aug 2010 10:33:41 +0200

On Aug 11, 2010, at 11:38 PM, Christopher Piggott wrote:

> Is there an easy way to combine what I get from
>
> @Context UriInfo context
> UriBuilder baseUri = context.getBasePathBuilder()
>
> with what I get from:
>
> UriBuilder.fromResource( OtherResource.class )
>
> what I want is a UriBuilder starting with the absolute path to the
> other resource, rather than a relative one. I could do it by
> manipulating strings, but was hoping somehow I wouldn't have to.
>

   context.getBasePathBuilder().path(OtherResource.class)

Paul.