public static String simpleHostname(String fullHostname) {
        if (InetAddresses.isInetAddress(fullHostname)) {
            return fullHostname;
        }
        int offset = fullHostname.indexOf('.');
        if (offset != -1) {
            return fullHostname.substring(0, offset);
        }
        return fullHostname;
    }
public static String simpleHostname(String fullHostname) {
        if (InetAddresses.isInetAddress(fullHostname)) {
            return fullHostname;
        }
        int offset = fullHostname.indexOf('.');
        if (offset != -1) {
            return fullHostname.substring(0, offset);
        }
        return fullHostname;
    }
public static String simpleHostname ( String fullHostname ) { if ( InetAddresses . isInetAddress ( fullHostname ) ) { return fullHostname ; } int offset = fullHostname . indexOf ( ' ' ) ; if ( offset != - 1 ) { return fullHostname . substring ( 0 , offset ) ; } return fullHostname ; }
Given a full hostname, return the word upto the first dot.
@param fullHostname the full hostname
@return the hostname to the first dot
Given a full hostname return the word upto the first dot .