Secure Java URL encoding and decoding