private Map<String, String> parseQuery(String uri) {
		Map<String, String> params = new HashMap<String, String>();

		try {
			for (String pair : uri.split("[?]")[1].split("&")) {
				String[] keyval = pair.split("[=]", 2);
				if (keyval.length == 1) {
					params.put(keyval[0], null);
				} else {
					try {
						params.put(keyval[0], URLDecoder.decode(keyval[1],
								TrackedTorrent.BYTE_ENCODING));
					} catch (UnsupportedEncodingException uee) {
						// Ignore, act like parameter was not there
					}
				}
			}
		} catch (ArrayIndexOutOfBoundsException e) {
			params.clear();
		}

		return params;
	}