Code example for URI

Methods: getHost

0
 
    public String getHost() {
        String url = getServerBaseUrl();
        URI uri;
        try { 
            uri = new URI(url);
        } catch (URISyntaxException e) {
            return null; 
        } 
        return uri.getHost();
    } 
 
    public int getHostIP() { 
        return getIPasInt(getHost()); 
    } 
 
    protected int getIPasInt(String hostname) {
        if (hostname == null) {
            return -1; 
        } 
        InetAddress inetAddress;