public String toURI(){
  final StringBuffer buffer=new StringBuffer(50);
  buffer.append(protocol.getScheme());
  buffer.append("://");
  buffer.append(hostname);
  if (port != protocol.getDefaultPort()) {
    buffer.append(':');
    buffer.append(port);
  }
  return buffer.toString();
}

public String toURI ( ) { final StringBuffer buffer = new StringBuffer ( 50 ) ; buffer . append ( protocol . getScheme ( ) ) ; buffer . append ( "://" ) ; buffer . append ( hostname ) ; if ( port != protocol . getDefaultPort ( ) ) { buffer . append ( ':' ) ; buffer . append ( port ) ; } return buffer . toString ( ) ; }
return the host uri .
