users@jax-rs-spec.java.net

[jax-rs-spec users] [jsr339-experts] Re: Why do we need special encodeSlashInPath methods again?

From: Markus KARG <markus_at_headcrashing.eu>
Date: Tue, 23 Oct 2012 19:01:50 +0200

> Is this true?
>
> assertEquals("a/b", UriBuilder.fromPath("{a}").buildFromEncoded("a/b");

Yes. "buildFromEncoded" prevents any kind of encoding, hence {a} is simply
replaced by the String "a/b" as is.

> If so, maybe we can add a method that encodes everything in a String,
> but the '/'.
>
> // encodes any '%' not followed by hexadecimal. Does not encode any
> legal URI characters.
>
> static String encode(String string) {...}
>
> Then users that want to retain the '/' can do:
>
> String myString = "a/b";
> assertEquals("a/b",
> UriBuilder.fromPath("{a}").buildFromEncoded(UriBuilder.encode(myString)
> );
>
> We add language to build() and buildFromMap methods that '/' is
> encoded.

What actual problem do you solve with this added complexity? This was all
discussed before. Please provide *actual* problems instead of posting
hypothetical solutions so we can talk about it. At the moment I do not see
what you try to reach.

>
>
>
> --
> Bill Burke
> JBoss, a division of Red Hat
> http://bill.burkecentral.com