users@jersey.java.net

Re: [Jersey] WebResource.getRequestBuilder()

From: Gili <cowwoc_at_bbs.darktech.org>
Date: Wed, 17 Dec 2008 10:02:13 -0800 (PST)

Also, shouldn't WebResource.Builder be a static inner class? Otherwise, why
ask for the URI twice? Once in the enclosing class and once in the
WebResource.Builder constructor.

Thanks,
Gili



Gili wrote:
>
> Sorry, I meant WebResource.Builder not WebRequest.Builder.
>
> The two options then become:
>
> WebResource.getBuilder(); // returns WebResource.Builder
> WebResource.getUriBuilder();
>
> or simply adding WebResource.getResourceBuilder() (eek!)
>
> Gili
>
>
> Gili wrote:
>>
>> Hi Paul,
>>
>> I just ran across WebResource.getBuilder() which returns a UriBuilder
>> which is kind of unfortunate because I think WebResource should return
>> two kinds of builders:
>>
>> 1) UriBuilder as you have now
>> 2) ClientRequest builder (this does not yet exist)
>>
>> I need the latter because I'm building a method that configures a
>> ClientRequest for conditional GETs by adding the necessary headers. Now,
>> I could define this method in terms of:
>>
>> public ClientRequest.Builder configure(WebResource resource);
>>
>> but then if someone else needs to configure the request before/after this
>> method then we have a problem. Ideally, this method should take
>> ClientRequest.Builder as input and return ClientRequest.Builder as
>> output.
>>
>> I'd like to propose two methods:
>>
>> WebResource.getRequestBuilder();
>> WebResource.getUriBuilder();
>>
>> Alternatively, leave getBuilder() as is and add WebResource.getRequest().
>> The former is a more consistent API at the cost of backwards
>> compatibility. Let me know what you think.
>>
>> Gili
>>
>
>

-- 
View this message in context: http://n2.nabble.com/WebResource.getRequestBuilder%28%29-tp1668929p1669004.html
Sent from the Jersey mailing list archive at Nabble.com.