users@jersey.java.net

[Jersey] WebResource.getRequestBuilder()

From: Gili <cowwoc_at_bbs.darktech.org>
Date: Wed, 17 Dec 2008 09:44:48 -0800 (PST)

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-tp1668929p1668929.html
Sent from the Jersey mailing list archive at Nabble.com.