class EnvironmentUtil {

    public static String[] splitHostFQDN(String fqdn) {
        String[] result = new String[2];

        if (StringUtil.isEmpty(fqdn)) {
            return result;
        }

        // try to determine the domain name
        int pos = fqdn.indexOf('.');
        if (pos >= 0) {
            result[0] = fqdn.substring(0, pos);
            if (pos+1 < fqdn.length()) {
                result[1] = fqdn.substring(pos+1);
            }
        } else {
            // entire string is the host name
            result[0] = fqdn;
        }

        return result;
    }

}