public static String buildUrlQuery ( String baseUrl , Map < String , String > params ) { if ( baseUrl . isEmpty ( ) || params . isEmpty ( ) ) { return baseUrl ; } else { String query = baseUrl ; query += QUERY_STRING_SEPARATOR ; for ( String key : params . keySet ( ) ) { query += key ; query += PAIR_SEPARATOR ; query += encodeString ( params . get ( key ) ) ; query += PARAM_SEPARATOR ; } return query . substring ( 0 , query . length ( ) - 1 ) ; } }
Builds the URL String .