Gotcha on points 2 and 3.  To avoid the slight hackiness of using `URI()`, how about using `URLCodec.encode` instead?  See: http://commons.apache.org/proper/commons-codec/apidocs/org/apache/commons/codec/net/URLCodec.html