Code example for CookieOrigin

Methods: getHost

0
            throw new IllegalArgumentException("Cookie may not be null");
        } 
        if (origin == null) {
            throw new IllegalArgumentException("Cookie origin may not be null");
        } 
        String host = origin.getHost().toLowerCase(Locale.ENGLISH);
        if (cookie.getDomain() == null) {
            throw new MalformedCookieException("Invalid cookie state: " +
                                               "domain not specified"); 
        } 
        String cookieDomain = cookie.getDomain().toLowerCase(Locale.ENGLISH);
 
        if (cookie instanceof ClientCookie 
                && ((ClientCookie) cookie).containsAttribute(ClientCookie.DOMAIN_ATTR)) {
            // Domain attribute must start with a dot 
            if (!cookieDomain.startsWith(".")) {
                throw new MalformedCookieException("Domain attribute \"" +
                    cookie.getDomain() + "\" violates RFC 2109: domain must start with a dot");
            } 
 
            // Domain attribute must contain at least one embedded dot,