public static String authorityFromHostAndPort ( String host , int port ) { try { return new URI ( null , null , host , port , null , null , null ) . getAuthority ( ) ; } catch ( URISyntaxException ex ) { throw new IllegalArgumentException ( "Invalid host or port: " + host + " " + port , ex ) ; } }
Combine a host and port into an authority string .