private String ipAddressFromURL ( String url , String name ) { String ipAddr = null ; if ( _urlValidator . isValid ( url ) ) { WebTarget resolver = ClientBuilder . newClient ( ) . target ( url ) ; try { ipAddr = resolver . request ( ) . get ( String . class ) ; } catch ( Exception e ) { warn ( "URL Cannot Resolve for resolveIP named [" + name + "]. The requested URL is invalid [" + url + "]." ) ; } } else { warn ( "The requested URL for resolveIP named [" + name + "] is invalid [" + url + "]." ) ; } return ipAddr ; }
Resolve the IP address from a URL .