Class CookieSpecBase

  • All Implemented Interfaces:
    CookieSpec
    Direct Known Subclasses:
    IgnoreSpecSpec

    @Contract(threading=SAFE)
    public abstract class CookieSpecBase
    extends AbstractCookieSpec
    Cookie management functions shared by all specification.
    Since:
    4.0
    • Constructor Detail

      • CookieSpecBase

        public CookieSpecBase()
      • CookieSpecBase

        protected CookieSpecBase​(java.util.HashMap<java.lang.String,​CookieAttributeHandler> map)
        Since:
        4.4
    • Method Detail

      • getDefaultPath

        protected static java.lang.String getDefaultPath​(CookieOrigin origin)
      • getDefaultDomain

        protected static java.lang.String getDefaultDomain​(CookieOrigin origin)
      • validate

        public void validate​(Cookie cookie,
                             CookieOrigin origin)
                      throws MalformedCookieException
        Description copied from interface: CookieSpec
        Validate the cookie according to validation rules defined by the cookie specification.
        Parameters:
        cookie - the Cookie to validate
        origin - details of the cookie origin
        Throws:
        MalformedCookieException - if the cookie is invalid
      • match

        public boolean match​(Cookie cookie,
                             CookieOrigin origin)
        Description copied from interface: CookieSpec
        Determines if a Cookie matches the target location.
        Parameters:
        cookie - the Cookie to be matched
        origin - the target to test against
        Returns:
        true if the cookie should be submitted with a request with given attributes, false otherwise.