FileDocCategorySizeDatePackage
BasicExpiresHandler.javaAPI DocAndroid 1.5 API2582Wed May 06 22:41:10 BST 2009org.apache.http.impl.cookie

BasicExpiresHandler

public class BasicExpiresHandler extends AbstractCookieAttributeHandler

Fields Summary
private final String[]
datepatterns
Valid date patterns
Constructors Summary
public BasicExpiresHandler(String[] datepatterns)

        if (datepatterns == null) {
            throw new IllegalArgumentException("Array of date patterns may not be null");
        }
        this.datepatterns = datepatterns;
    
Methods Summary
public voidparse(org.apache.http.cookie.SetCookie cookie, java.lang.String value)

        if (cookie == null) {
            throw new IllegalArgumentException("Cookie may not be null");
        }
        if (value == null) {
            throw new MalformedCookieException("Missing value for expires attribute");
        }
        try {
            cookie.setExpiryDate(DateUtils.parseDate(value, this.datepatterns));
        } catch (DateParseException dpe) {
            throw new MalformedCookieException("Unable to parse expires attribute: " 
                + value);
        }