public String constructRedirectUrl ( final String casServerLoginUrl , final String serviceParameterName , final String serviceUrl , final boolean renew , final boolean gateway ) { try { return casServerLoginUrl + ( casServerLoginUrl . indexOf ( "?" ) != - 1 ? "&" : "?" ) + serviceParameterName + "=" + URLEncoder . encode ( serviceUrl , "UTF-8" ) + ( renew ? "&renew=true" : "" ) + ( gateway ? "&gateway=true" : "" ) + "&" + SessionIdReader . SessionIdName + "=" + sessionIdReader . idName ( ) ; } catch ( final UnsupportedEncodingException e ) { throw new RuntimeException ( e ) ; } }
Constructs the URL to use to redirect to the CAS server .