Parses query string using Java.net library