public static String addParameter ( final String url , final String name , final String value ) { if ( url != null ) { final StringBuilder sb = new StringBuilder ( ) ; sb . append ( url ) ; if ( name != null ) { if ( url . indexOf ( "?" ) >= 0 ) { sb . append ( "&" ) ; } else { sb . append ( "?" ) ; } sb . append ( name ) ; sb . append ( "=" ) ; if ( value != null ) { sb . append ( urlEncode ( value ) ) ; } } return sb . toString ( ) ; } return null ; }
Add a new parameter to an url .