Svetoslav Neykov created BROOKLYN-437:
-----------------------------------------
Summary: Deprecate Url.{encode,decode} and other uses of URLEncoder
Key: BROOKLYN-437
URL: https://issues.apache.org/jira/browse/BROOKLYN-437
Project: Brooklyn
Issue Type: Improvement
Reporter: Svetoslav Neykov
{{URLEncoder}} is used for encoding the data in the body of a POST request.
While close to the encoding of parameters in the URL query part it's not the
same. It's used for encoding other parts of the URL as well like the
username/password pair or path elements. While this works fine in testing
scenarios and straightforward usage it will fail in some edge cases, leading to
hard to troubleshoot intermittent errors.
I suggest we replace it with a URL builder instead where it's possible to
express which part of the URL needs escaping.
One possible option is https://github.com/mikaelhg/urlbuilder. It's standalone
with minimal dependencies. Suggest going through the test coverage before
deciding on it though.
There are other alternative implementations, usually bundles with jax-rs
implementations which makes them much more heavy. Could already have one coming
from CXF - needs checking.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)