/** * Returns the actual cookie policy * * @param state HTTP state. TODO: to be removed in the future * * @return cookie spec */ private CookieSpec getCookieSpec(final HttpState state) { if (this.cookiespec == null) { int i = state.getCookiePolicy(); if (i == -1) { this.cookiespec = CookiePolicy.getCookieSpec(this.params.getCookiePolicy()); } else { this.cookiespec = CookiePolicy.getSpecByPolicy(i); } this.cookiespec.setValidDateFormats( (Collection)this.params.getParameter(HttpMethodParams.DATE_PATTERNS)); } return this.cookiespec; }
/** * Return a textual representation of the cookie. * * @return string. */ public String toExternalForm() { CookieSpec spec = null; if (getVersion() > 0) { spec = CookiePolicy.getDefaultSpec(); } else { spec = CookiePolicy.getCookieSpec(CookiePolicy.NETSCAPE); } return spec.formatCookie(this); }
/** * Return a textual representation of the cookie. * * @return string. */ public String toExternalForm() { CookieSpec spec = CookiePolicy.getCookieSpec(CookiePolicy.RFC_2965); return spec.formatCookie(this); }
LOG.trace("enter HttpState.getCookies(String, int, String, boolean)"); CookieSpec matcher = CookiePolicy.getDefaultSpec(); ArrayList list = new ArrayList(cookies.size()); for (int i = 0, m = cookies.size(); i < m; i++) {
/** * @return cookie specification interface that provides high compatibilty * with common cookie management of popular HTTP agents * * @deprecated Use {@link CookiePolicy#getCookieSpec(String)} */ public static CookieSpec getCompatibilitySpec() { return getSpecByPolicy(COMPATIBILITY); }
CookiePolicy.registerCookieSpec(CookiePolicy.DEFAULT, cookiePolicyClass); cookieSpec=CookiePolicy.getDefaultSpec();
/** * Returns {@link CookieSpec cookie specification} registered as {@link #DEFAULT}. * If no default {@link CookieSpec cookie specification} has been registered, * {@link RFC2109Spec RFC2109 specification} is returned. * * @return default {@link CookieSpec cookie specification} * * @see #DEFAULT */ public static CookieSpec getDefaultSpec() { try { return getCookieSpec(DEFAULT); } catch (IllegalStateException e) { LOG.warn("Default cookie policy is not registered"); return new RFC2109Spec(); } }
/** * Gets the CookieSpec for a particular cookie version. * * <p>Supported versions: * <ul> * <li><tt>version 0</tt> corresponds to the Netscape draft * <li><tt>version 1</tt> corresponds to the RFC 2109 * <li>Any other cookie value coresponds to the default spec * <ul> * * @param ver the cookie version to get the spec for * @return cookie specification interface intended for processing * cookies with the given version * * @deprecated Use {@link CookiePolicy#getCookieSpec(String)} */ public static CookieSpec getSpecByVersion(int ver) { switch(ver) { case 0: return new NetscapeDraftSpec(); case 1: return new RFC2109Spec(); default: return getDefaultSpec(); } }
/** * @return cookie specification interface that provides high compatibilty * with common cookie management of popular HTTP agents * * @deprecated Use {@link CookiePolicy#getCookieSpec(String)} */ public static CookieSpec getCompatibilitySpec() { return getSpecByPolicy(COMPATIBILITY); }
/** * Returns the actual cookie policy * * @param state HTTP state. TODO: to be removed in the future * * @return cookie spec */ private CookieSpec getCookieSpec(final HttpState state) { if (this.cookiespec == null) { int i = state.getCookiePolicy(); if (i == -1) { this.cookiespec = CookiePolicy.getCookieSpec(this.params.getCookiePolicy()); } else { this.cookiespec = CookiePolicy.getSpecByPolicy(i); } this.cookiespec.setValidDateFormats( (Collection)this.params.getParameter(HttpMethodParams.DATE_PATTERNS)); } return this.cookiespec; }
/** * Return a textual representation of the cookie. * * @return string. */ public String toExternalForm() { CookieSpec spec = null; if (getVersion() > 0) { spec = CookiePolicy.getDefaultSpec(); } else { spec = CookiePolicy.getCookieSpec(CookiePolicy.NETSCAPE); } return spec.formatCookie(this); }
/** * Return a textual representation of the cookie. * * @return string. */ public String toExternalForm() { CookieSpec spec = CookiePolicy.getCookieSpec(CookiePolicy.RFC_2965); return spec.formatCookie(this); }
/** * @param policy cookie policy to get the CookieSpec for * @return cookie specification interface for the given policy * * @deprecated Use {@link CookiePolicy#getCookieSpec(String)} */ public static CookieSpec getSpecByPolicy(int policy) { switch(policy) { case COMPATIBILITY: return new CookieSpecBase(); case NETSCAPE_DRAFT: return new NetscapeDraftSpec(); case RFC2109: return new RFC2109Spec(); case RFC2965: return new RFC2965Spec(); default: return getDefaultSpec(); } }
/** * @return cookie specification interface that provides high compatibilty * with common cookie management of popular HTTP agents * * @deprecated Use {@link CookiePolicy#getCookieSpec(String)} */ public static CookieSpec getCompatibilitySpec() { return getSpecByPolicy(COMPATIBILITY); }
/** * Returns the actual cookie policy * * @param state HTTP state. TODO: to be removed in the future * * @return cookie spec */ private CookieSpec getCookieSpec(final HttpState state) { if (this.cookiespec == null) { int i = state.getCookiePolicy(); if (i == -1) { this.cookiespec = CookiePolicy.getCookieSpec(this.params.getCookiePolicy()); } else { this.cookiespec = CookiePolicy.getSpecByPolicy(i); } this.cookiespec.setValidDateFormats( (Collection)this.params.getParameter(HttpMethodParams.DATE_PATTERNS)); } return this.cookiespec; }
/** * Return a textual representation of the cookie. * * @return string. */ public String toExternalForm() { CookieSpec spec = null; if (getVersion() > 0) { spec = CookiePolicy.getDefaultSpec(); } else { spec = CookiePolicy.getCookieSpec(CookiePolicy.NETSCAPE); } return spec.formatCookie(this); }
/** * Return a textual representation of the cookie. * * @return string. */ public String toExternalForm() { CookieSpec spec = CookiePolicy.getCookieSpec(CookiePolicy.RFC_2965); return spec.formatCookie(this); }
LOG.trace("enter HttpState.getCookies(String, int, String, boolean)"); CookieSpec matcher = CookiePolicy.getDefaultSpec(); ArrayList list = new ArrayList(cookies.size()); for (int i = 0, m = cookies.size(); i < m; i++) {
/** * @return cookie specification interface that provides high compatibilty * with common cookie management of popular HTTP agents * * @deprecated Use {@link CookiePolicy#getCookieSpec(String)} */ public static CookieSpec getCompatibilitySpec() { return getSpecByPolicy(COMPATIBILITY); }
/** * Returns the actual cookie policy * * @param state HTTP state. TODO: to be removed in the future * * @return cookie spec */ private CookieSpec getCookieSpec(final HttpState state) { if (this.cookiespec == null) { int i = state.getCookiePolicy(); if (i == -1) { this.cookiespec = CookiePolicy.getCookieSpec(this.params.getCookiePolicy()); } else { this.cookiespec = CookiePolicy.getSpecByPolicy(i); } this.cookiespec.setValidDateFormats( (Collection)this.params.getParameter(HttpMethodParams.DATE_PATTERNS)); } return this.cookiespec; }