title: A good library to do URL Query String manipulation in Java
body: <p>I need to do a few very simple URL manipulations in Java. Like get the value for a parameter in the query, or update it, ... I was expecting to find a simple utility class doing that in the commons-lang package, but no. I know it is a simple problem, but if there is something already written, why do it again ? Do you know of any ?</p>
  
  <p>I would like to have at least the following capabilities :</p>
  
  <pre><code>String myUrl = "http://www.example.com/test.html?toto=1&amp;titi=2";
  
  // get the value of a parameter
  String parameterValue = UrlUtils.getParameterValue(myUrl, "toto");
  Assert.equals(parameterValue, "1");
  
  // update a parameter
  String newUrl = UrlUtils.updateParameter(myUrl, "toto", 3);
  parameterValue = UrlUtils.getParameterValue(myUrl, "toto");
  Assert.equals(parameterValue, "3");
  </code></pre>
  
  <p>Ideally, it would take care of all encoding related issues, and work with java.net.Url as well as with Strings.</p>
  
  <p>Thanks for your help !</p>