private String nextUrlBaseToken(String url){
  StringBuffer token=new StringBuffer();
  while (urlBaseEndIndex < url.length()) {
    char ch=url.charAt(urlBaseEndIndex++);
    if (ch == ':' || ch == ';' || ch == '?') {
      break;
    }
    if (ch == '/') {
      if (urlBaseEndIndex < url.length() && url.charAt(urlBaseEndIndex) == '/') {
        urlBaseEndIndex++;
        continue;
      }
 else {
        break;
      }
    }
    token.append(ch);
  }
  if (token.length() == 0)   return null;
 else   return token.toString();
}

private String nextUrlBaseToken ( String url ) { StringBuffer token = new StringBuffer ( ) ; while ( urlBaseEndIndex < url . length ( ) ) { char ch = url . charAt ( urlBaseEndIndex ++ ) ; if ( ch == ':' || ch == ';' || ch == '?' ) { break ; } if ( ch == '/' ) { if ( urlBaseEndIndex < url . length ( ) && url . charAt ( urlBaseEndIndex ) == '/' ) { urlBaseEndIndex ++ ; continue ; } else { break ; } } token . append ( ch ) ; } if ( token . length ( ) == 0 ) return null ; else return token . toString ( ) ; }
extracts the next lexical token from the provided url base .
