public static String appendParametersToQueryString ( String url , Map < String , String > params ) { Preconditions . checkNotNull ( url , "Cannot append to null URL" ) ; String queryString = URLUtils . formURLEncodeMap ( params ) ; if ( queryString . equals ( EMPTY_STRING ) ) { return url ; } else { url += ( url . indexOf ( QUERY_STRING_SEPARATOR ) != - 1 ) ? PARAM_SEPARATOR : QUERY_STRING_SEPARATOR ; url += queryString ; return url ; } }
Append given parameters to the query string of the url