private String[] parseURL(
		String url
	) {
		if (url == null) {
			return null;
		}
		
		String[] parts = new String[8];
		
		// Remove leading and trailing whitespace
		url = url.trim();
		
		// Fragment
		int fragment_index = url.indexOf(FRAGMENT_DELIM);
		if (fragment_index < 0) {
			parts[7] = null;
		} else {
			parts[7] = url.substring(fragment_index + 1);
			url = url.substring(0, fragment_index);
		}
		
		// Query
		int query_index = url.lastIndexOf(QUERY_DELIM);
		if (query_index < 0) {
			parts[6] = null;
		} else {
			parts[6] = url.substring(query_index + 1);
			url = url.substring(0, query_index);
		}
		
		// Protocol
		int first_colon = url.indexOf(':');
		int first_slash = url.indexOf('/');
		if (first_colon >= 0 && first_colon + 1 == first_slash) {
			parts[0] = url.substring(0, first_colon);
			url = url.substring(first_colon + 1);
		}
		
		// Authority
		if (url.startsWith("//")) {
			url = url.substring(2);
			int next_slash = url.indexOf(PATH_DELIM);
			if (next_slash >= 0) {
				parts[1] = url.substring(0, next_slash);
				url = url.substring(next_slash);
			} else {
				parts[1] = url;
				url = "";
			}
			
			String[] authority_parts = parseAuthority(parts[1]);
			parts[2] = authority_parts[0];
			parts[3] = authority_parts[1];
			parts[4] = authority_parts[2];
		}
		
		// Path
		parts[5] = url;
		
		return parts;
	}