private static String correctServerURI(String uri){
  int i=uri.length() - 1;
  while (i > 0 && uri.codePointAt(i) == '/') {
    i--;
  }
  String returnedUri=uri.substring(0,i + 1);
  LOG.debug("corrected server URI to: " + uri);
  return returnedUri;
}

private static String correctServerURI ( String uri ) { int i = uri . length ( ) - 1 ; while ( i > 0 && uri . codePointAt ( i ) == '/' ) { i -- ; } String returnedUri = uri . substring ( 0 , i + 1 ) ; LOG . debug ( "corrected server URI to: " + uri ) ; return returnedUri ; }
takes a server uri and removes unwanted characters like trailing slashes from it .
