/** Default constructor */ public NetscapeDraftSpec(final String[] datepatterns) { super(); if (datepatterns != null) { this.datepatterns = datepatterns.clone(); } else { this.datepatterns = new String[] { EXPIRES_PATTERN }; } registerAttribHandler(ClientCookie.PATH_ATTR, new BasicPathHandler()); registerAttribHandler(ClientCookie.DOMAIN_ATTR, new NetscapeDomainHandler()); registerAttribHandler(ClientCookie.MAX_AGE_ATTR, new BasicMaxAgeHandler()); registerAttribHandler(ClientCookie.SECURE_ATTR, new BasicSecureHandler()); registerAttribHandler(ClientCookie.COMMENT_ATTR, new BasicCommentHandler()); registerAttribHandler(ClientCookie.EXPIRES_ATTR, new BasicExpiresHandler( this.datepatterns)); }
public void validate(final Cookie cookie, final CookieOrigin origin) throws MalformedCookieException { if (!match(cookie, origin)) { throw new MalformedCookieException( "Illegal path attribute \"" + cookie.getPath() + "\". Path of origin: \"" + origin.getPath() + "\""); } }
@Override public boolean match(final Cookie cookie, final CookieOrigin origin) { Args.notNull(cookie, "Cookie"); Args.notNull(origin, "Cookie origin"); return pathMatch(origin.getPath(), cookie.getPath()); }
@Override public boolean match(final Cookie cookie, final CookieOrigin origin) { Args.notNull(cookie, "Cookie"); Args.notNull(origin, "Cookie origin"); return pathMatch(origin.getPath(), cookie.getPath()); }
/** Default constructor */ public BrowserCompatSpec(final String[] datepatterns) { super(); if (datepatterns != null) { this.datepatterns = datepatterns.clone(); } else { this.datepatterns = DATE_PATTERNS; } registerAttribHandler(ClientCookie.PATH_ATTR, new BasicPathHandler()); registerAttribHandler(ClientCookie.DOMAIN_ATTR, new BasicDomainHandler()); registerAttribHandler(ClientCookie.MAX_AGE_ATTR, new BasicMaxAgeHandler()); registerAttribHandler(ClientCookie.SECURE_ATTR, new BasicSecureHandler()); registerAttribHandler(ClientCookie.COMMENT_ATTR, new BasicCommentHandler()); registerAttribHandler(ClientCookie.EXPIRES_ATTR, new BasicExpiresHandler( this.datepatterns)); }
public void validate(final Cookie cookie, final CookieOrigin origin) throws MalformedCookieException { if (!match(cookie, origin)) { throw new MalformedCookieException( "Illegal path attribute \"" + cookie.getPath() + "\". Path of origin: \"" + origin.getPath() + "\""); } }
@Override public boolean match(final Cookie cookie, final CookieOrigin origin) { Args.notNull(cookie, "Cookie"); Args.notNull(origin, "Cookie origin"); return pathMatch(origin.getPath(), cookie.getPath()); }
/** Default constructor */ public RFC2109Spec(final String[] datepatterns, boolean oneHeader) { super(); if (datepatterns != null) { this.datepatterns = datepatterns.clone(); } else { this.datepatterns = DATE_PATTERNS; } this.oneHeader = oneHeader; registerAttribHandler(ClientCookie.VERSION_ATTR, new RFC2109VersionHandler()); registerAttribHandler(ClientCookie.PATH_ATTR, new BasicPathHandler()); registerAttribHandler(ClientCookie.DOMAIN_ATTR, new RFC2109DomainHandler()); registerAttribHandler(ClientCookie.MAX_AGE_ATTR, new BasicMaxAgeHandler()); registerAttribHandler(ClientCookie.SECURE_ATTR, new BasicSecureHandler()); registerAttribHandler(ClientCookie.COMMENT_ATTR, new BasicCommentHandler()); registerAttribHandler(ClientCookie.EXPIRES_ATTR, new BasicExpiresHandler( this.datepatterns)); }
@Override public void validate(final Cookie cookie, final CookieOrigin origin) throws MalformedCookieException { if (!match(cookie, origin)) { throw new CookieRestrictionViolationException( "Illegal 'path' attribute \"" + cookie.getPath() + "\". Path of origin: \"" + origin.getPath() + "\""); } }
@Override public boolean match(final Cookie cookie, final CookieOrigin origin) { Args.notNull(cookie, "Cookie"); Args.notNull(origin, "Cookie origin"); return pathMatch(origin.getPath(), cookie.getPath()); }
public RFC6265LaxSpec() { super(new BasicPathHandler(), new BasicDomainHandler(), new LaxMaxAgeHandler(), new BasicSecureHandler(), new LaxExpiresHandler()); }
@Override public boolean match(final Cookie cookie, final CookieOrigin origin) { CookieOrigin newOrigin = origin; String targetpath = origin.getPath(); if (browserVersion_.hasFeature(HTTP_COOKIE_EXTRACT_PATH_FROM_LOCATION) && !targetpath.isEmpty()) { final int lastSlashPos = targetpath.lastIndexOf('/'); if (lastSlashPos > 1 && lastSlashPos < targetpath.length()) { targetpath = targetpath.substring(0, lastSlashPos); newOrigin = new CookieOrigin(origin.getHost(), origin.getPort(), targetpath, origin.isSecure()); } } return super.match(cookie, newOrigin); } }
@Override public boolean match(final Cookie cookie, final CookieOrigin origin) { Args.notNull(cookie, "Cookie"); Args.notNull(origin, "Cookie origin"); return pathMatch(origin.getPath(), cookie.getPath()); }
public RFC6265StrictSpec() { super(new BasicPathHandler(), new BasicDomainHandler(), new BasicMaxAgeHandler(), new BasicSecureHandler(), new BasicExpiresHandler(DATE_PATTERNS)); }
public void validate(final Cookie cookie, final CookieOrigin origin) throws MalformedCookieException { if (!match(cookie, origin)) { throw new CookieRestrictionViolationException( "Illegal path attribute \"" + cookie.getPath() + "\". Path of origin: \"" + origin.getPath() + "\""); } }
public RFC6265LaxSpec() { super(new BasicPathHandler(), new BasicDomainHandler(), new LaxMaxAgeHandler(), new BasicSecureHandler(), new LaxExpiresHandler()); }
public void validate(final Cookie cookie, final CookieOrigin origin) throws MalformedCookieException { if (!match(cookie, origin)) { throw new MalformedCookieException( "Illegal path attribute \"" + cookie.getPath() + "\". Path of origin: \"" + origin.getPath() + "\""); } }
public RFC6265StrictSpec() { super(new BasicPathHandler(), new BasicDomainHandler(), new BasicMaxAgeHandler(), new BasicSecureHandler(), new BasicExpiresHandler(DATE_PATTERNS)); }
public void validate(final Cookie cookie, final CookieOrigin origin) throws MalformedCookieException { if (!match(cookie, origin)) { throw new MalformedCookieException( "Illegal path attribute \"" + cookie.getPath() + "\". Path of origin: \"" + origin.getPath() + "\""); } }
public RFC6265LaxSpec() { super(new BasicPathHandler(), new BasicDomainHandler(), new LaxMaxAgeHandler(), new BasicSecureHandler(), new LaxExpiresHandler()); }