private String getHostname(String url) {
		if (url.indexOf("@") >= 0) return null;
		
		int begin = url.indexOf("//");
		if (begin < 0) {
			begin = 0;
		} else {
			begin = begin + 2;
		}
		
		int end = url.length();
		int index = url.indexOf("/", begin);
		if (index >= 0 && index < end) {
			end = index;
		}
		
		index = url.indexOf("?", begin);
		if (index >= 0 && index < end) {
			end = index;
		}
		
		index = url.indexOf(":", begin);
		if (index >= 0 && index < end) {
			end = index;
		}
		
		url = url.substring(begin, end);
		while (url.endsWith(".")) {
			url = url.substring(0, url.length() - 1);
		}
		
		return url;
	}