/** * 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(); } }
/** * @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(); } }
/** * Default constructor * */ public RFC2965Spec() { super(); this.formatter = new ParameterFormatter(); this.formatter.setAlwaysUseQuotes(true); this.attribHandlerMap = new HashMap(10); this.attribHandlerList = new ArrayList(10); this.rfc2109 = new RFC2109Spec(); registerAttribHandler(Cookie2.PATH, new Cookie2PathAttributeHandler()); registerAttribHandler(Cookie2.DOMAIN, new Cookie2DomainAttributeHandler()); registerAttribHandler(Cookie2.PORT, new Cookie2PortAttributeHandler()); registerAttribHandler(Cookie2.MAXAGE, new Cookie2MaxageAttributeHandler()); registerAttribHandler(Cookie2.SECURE, new CookieSecureAttributeHandler()); registerAttribHandler(Cookie2.COMMENT, new CookieCommentAttributeHandler()); registerAttribHandler(Cookie2.COMMENTURL, new CookieCommentUrlAttributeHandler()); registerAttribHandler(Cookie2.DISCARD, new CookieDiscardAttributeHandler()); registerAttribHandler(Cookie2.VERSION, new Cookie2VersionAttributeHandler()); }
/** * @return the {@link CookieSpec} (defaults to {@link RFC2109Spec} when spec is * null) */ public static CookieSpec getCookieSpec(String spec) { if (spec != null && spec.equalsIgnoreCase(HttpConnector.COOKIE_SPEC_NETSCAPE)) { return new NetscapeDraftSpec(); } else { return new RFC2109Spec(); } }
/** * 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(); } }
/** * 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(); } }
/** * 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(); } }
/** * 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(); } }
/** * 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(); } }
/** * 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(); } }
/** * @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(); } }
/** * @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(); } }
/** * @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(); } }
/** * @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(); } }
/** * Default constructor * */ public RFC2965Spec() { super(); this.formatter = new ParameterFormatter(); this.formatter.setAlwaysUseQuotes(true); this.attribHandlerMap = new HashMap(10); this.attribHandlerList = new ArrayList(10); this.rfc2109 = new RFC2109Spec(); registerAttribHandler(Cookie2.PATH, new Cookie2PathAttributeHandler()); registerAttribHandler(Cookie2.DOMAIN, new Cookie2DomainAttributeHandler()); registerAttribHandler(Cookie2.PORT, new Cookie2PortAttributeHandler()); registerAttribHandler(Cookie2.MAXAGE, new Cookie2MaxageAttributeHandler()); registerAttribHandler(Cookie2.SECURE, new CookieSecureAttributeHandler()); registerAttribHandler(Cookie2.COMMENT, new CookieCommentAttributeHandler()); registerAttribHandler(Cookie2.COMMENTURL, new CookieCommentUrlAttributeHandler()); registerAttribHandler(Cookie2.DISCARD, new CookieDiscardAttributeHandler()); registerAttribHandler(Cookie2.VERSION, new Cookie2VersionAttributeHandler()); }
/** * Default constructor * */ public RFC2965Spec() { super(); this.formatter = new ParameterFormatter(); this.formatter.setAlwaysUseQuotes(true); this.attribHandlerMap = new HashMap(10); this.attribHandlerList = new ArrayList(10); this.rfc2109 = new RFC2109Spec(); registerAttribHandler(Cookie2.PATH, new Cookie2PathAttributeHandler()); registerAttribHandler(Cookie2.DOMAIN, new Cookie2DomainAttributeHandler()); registerAttribHandler(Cookie2.PORT, new Cookie2PortAttributeHandler()); registerAttribHandler(Cookie2.MAXAGE, new Cookie2MaxageAttributeHandler()); registerAttribHandler(Cookie2.SECURE, new CookieSecureAttributeHandler()); registerAttribHandler(Cookie2.COMMENT, new CookieCommentAttributeHandler()); registerAttribHandler(Cookie2.COMMENTURL, new CookieCommentUrlAttributeHandler()); registerAttribHandler(Cookie2.DISCARD, new CookieDiscardAttributeHandler()); registerAttribHandler(Cookie2.VERSION, new Cookie2VersionAttributeHandler()); }
/** * Default constructor * */ public RFC2965Spec() { super(); this.formatter = new ParameterFormatter(); this.formatter.setAlwaysUseQuotes(true); this.attribHandlerMap = new HashMap(10); this.attribHandlerList = new ArrayList(10); this.rfc2109 = new RFC2109Spec(); registerAttribHandler(Cookie2.PATH, new Cookie2PathAttributeHandler()); registerAttribHandler(Cookie2.DOMAIN, new Cookie2DomainAttributeHandler()); registerAttribHandler(Cookie2.PORT, new Cookie2PortAttributeHandler()); registerAttribHandler(Cookie2.MAXAGE, new Cookie2MaxageAttributeHandler()); registerAttribHandler(Cookie2.SECURE, new CookieSecureAttributeHandler()); registerAttribHandler(Cookie2.COMMENT, new CookieCommentAttributeHandler()); registerAttribHandler(Cookie2.COMMENTURL, new CookieCommentUrlAttributeHandler()); registerAttribHandler(Cookie2.DISCARD, new CookieDiscardAttributeHandler()); registerAttribHandler(Cookie2.VERSION, new Cookie2VersionAttributeHandler()); }
/** * Default constructor * */ public RFC2965Spec() { super(); this.formatter = new ParameterFormatter(); this.formatter.setAlwaysUseQuotes(true); this.attribHandlerMap = new HashMap(10); this.attribHandlerList = new ArrayList(10); this.rfc2109 = new RFC2109Spec(); registerAttribHandler(Cookie2.PATH, new Cookie2PathAttributeHandler()); registerAttribHandler(Cookie2.DOMAIN, new Cookie2DomainAttributeHandler()); registerAttribHandler(Cookie2.PORT, new Cookie2PortAttributeHandler()); registerAttribHandler(Cookie2.MAXAGE, new Cookie2MaxageAttributeHandler()); registerAttribHandler(Cookie2.SECURE, new CookieSecureAttributeHandler()); registerAttribHandler(Cookie2.COMMENT, new CookieCommentAttributeHandler()); registerAttribHandler(Cookie2.COMMENTURL, new CookieCommentUrlAttributeHandler()); registerAttribHandler(Cookie2.DISCARD, new CookieDiscardAttributeHandler()); registerAttribHandler(Cookie2.VERSION, new Cookie2VersionAttributeHandler()); }