标准URL定义方式
//URI uriFindAllFastGroup = URIUtils.createURI("http", host, port, findAllFastGroupUrl, null, null);
List<NameValuePair> qparamsPreload = new ArrayList<NameValuePair>();
qparamsPreload.add(new BasicNameValuePair("appCode", appCodePreload));
qparamsPreload.add(new BasicNameValuePair("enable","true"));
URI uriPreload = URIUtils.createURI("http", host, port, serverIdUrl,URLEncodedUtils.format(qparamsPreload, "UTF-8"), null);
public class URIUtils {
/**
* Constructs a {@link URI} using all the parameters. This should be
* used instead of
* {@link URI#URI(String, String, String, int, String, String, String)}
* or any of the other URI multi-argument URI constructors.
*
* @param scheme
* Scheme name
* @param host
* Host name
* @param port
* Port number
* @param path
* Path
* @param query
* Query
* @param fragment
* Fragment
*
* @throws URISyntaxException
* If both a scheme and a path are given but the path is
* relative, if the URI string constructed from the given
* components violates RFC 2396, or if the authority
* component of the string is present but cannot be parsed
* as a server-based authority
*/
public static URI createURI(
final String scheme,
final String host,
int port,
final String path,
final String query,
final String fragment) throws URISyntaxException{...}
}