code: public void setHost( String host )
      {
          _host = null;
          if ( host != null && host.length() > 0 )
          {
              //
              // Here's some very minimal support for IPv6 addresses.
              // If the literal IPv6 address is not enclosed in square brackets
              // then add them.
              //
              boolean needBrackets = ( ( host.indexOf( ':' ) >= 0 )
                      && !host.startsWith( "[" )
                      && !host.endsWith( "]" ) );
  
              if ( needBrackets )
              {
                  _host = '[' + host + ']';
              }
              else
              {
                  _host = host;
              }
  
              _opaque = false;
              setSchemeSpecificPart( null );
          }
  
          if ( _host == null )
          {
              setUserInfo( null );
              setPort( UNDEFINED_PORT );
          }
      }
docs: Sets the host.
  
  @param host host