FileDocCategorySizeDatePackage
CookieOrigin.javaAPI DocAndroid 1.5 API3443Wed May 06 22:41:10 BST 2009org.apache.http.cookie

CookieOrigin

public final class CookieOrigin extends Object
CookieOrigin class incapsulates details of an origin server that are relevant when parsing, validating or matching HTTP cookies.
author
Oleg Kalnichevski
since
4.0

Fields Summary
private final String
host
private final int
port
private final String
path
private final boolean
secure
Constructors Summary
public CookieOrigin(String host, int port, String path, boolean secure)

        super();
        if (host == null) {
            throw new IllegalArgumentException(
                    "Host of origin may not be null");
        }
        if (host.trim().length() == 0) {
            throw new IllegalArgumentException(
                    "Host of origin may not be blank");
        }
        if (port < 0) {
            throw new IllegalArgumentException("Invalid port: " + port);
        }
        if (path == null) {
            throw new IllegalArgumentException(
                    "Path of origin may not be null.");
        }
        this.host = host.toLowerCase(Locale.ENGLISH);
        this.port = port;
        if (path.trim().length() != 0) {
            this.path = path;
        } else {
            this.path = "/";
        }
        this.secure = secure;
    
Methods Summary
public java.lang.StringgetHost()

        return this.host;
    
public java.lang.StringgetPath()

        return this.path;
    
public intgetPort()

        return this.port;
    
public booleanisSecure()

        return this.secure;
    
public java.lang.StringtoString()

        StringBuilder buffer = new StringBuilder();
        buffer.append('[");
        if (this.secure) {
            buffer.append("(secure)");
        }
        buffer.append(this.host);
        buffer.append(':");
        buffer.append(Integer.toString(this.port));
        buffer.append(this.path);
        buffer.append(']");
        return buffer.toString();