users@jsr311.java.net

Re: JAX-RS: UriBuilder encoding

From: Marc Hadley <Marc.Hadley_at_Sun.COM>
Date: Thu, 24 Jul 2008 12:19:42 -0400

I've checked in a new version of the code and javadoc:

https://jsr311.dev.java.net/nonav/javadoc/javax/ws/rs/core/UriBuilder.html

I think I captured everything we discussed but a couple of extra pairs
of eyes wouldn't go amiss.

Marc.

On Jul 24, 2008, at 4:30 AM, Stephan Koops wrote:

> Hi Marc,
>>>> What about add build methods, where you could give an encode
>>>> state? But UriBuilder.buildFromMap(Map, boolean) is no problem,
>>>> but UriBuilder.build(Object..., boolean) won't work. What about
>>>> UriBuilder.buildEncode(Object...), which encode all characters,
>>>> and UriBuilder.build(Object...) only the characters that must be
>>>> converted?
>>>>
>>>> What's the problem with adding a third state for the encode
>>>> attribute, and let all other as it is?
>>>>
>>> I've done the exercise of switching to a single state and the
>>> result is significantly simpler. Adding a third state makes things
>>> more complex than the status quo. Adding additional build methods
>>> that force encoding of % chars in parameter values would be
>>> preferable.
>>>
>> BTW, we could have:
>>
>> build(boolean, Object...) and buildFromMap(boolean, Map<String, ?
>> extends Object>)
> I also thought about this, but typically you put switches like this
> to the end of the parameter list. But this is also a flexible
> possibility.
>> I think these would negate the need for the static encode method.
> Yes, that's what I want. :-)
>
> best regards
> Stephan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe_at_jsr311.dev.java.net
> For additional commands, e-mail: users-help_at_jsr311.dev.java.net
>

---
Marc Hadley <marc.hadley at sun.com>
CTO Office, Sun Microsystems.