public String getAuthority ( HttpUrl url ) { String scheme = url . scheme ( ) ; String host = url . host ( ) ; int port = url . port ( ) ; StringBuilder builder = new StringBuilder ( ) ; if ( scheme != null ) { builder . append ( scheme ) . append ( "://" ) ; } builder . append ( host ) ; if ( port >= 0 ) { builder . append ( ' ' ) . append ( port ) ; } return builder . toString ( ) ; }
Gets authority of a url .