private String trimUrl(String uri){
  if (uri == null)   return "";
  if (uri.endsWith("/"))   uri=uri.substring(0,uri.length() - 1);
  return uri;
}

private String trimUrl ( String uri ) { if ( uri == null ) return "" ; if ( uri . endsWith ( "/" ) ) uri = uri . substring ( 0 , uri . length ( ) - 1 ) ; return uri ; }
trim the url , by removing an extra ' / ' at the end of the url and also make it lowercase < p >
