Package org.browsermob.proxy.http

Source Code of org.browsermob.proxy.http.BlankCookieStore

package org.browsermob.proxy.http;

import org.apache.http.client.CookieStore;
import org.apache.http.cookie.Cookie;
import org.browsermob.core.har.HarCookie;

import java.util.Collections;
import java.util.Date;
import java.util.List;

public class BlankCookieStore implements CookieStore {
    @Override
    public void addCookie(Cookie cookie) {
        HarCookie hc = new HarCookie();
        hc.setDomain(cookie.getDomain());
        hc.setExpires(cookie.getExpiryDate());
        hc.setName(cookie.getName());
        hc.setValue(cookie.getValue());
        hc.setPath(cookie.getPath());
        RequestInfo.get().getEntry().getResponse().getCookies().add(hc);
    }

    @Override
    public List<Cookie> getCookies() {
        return Collections.emptyList();
    }

    @Override
    public boolean clearExpired(Date date) {
        return false;
    }

    @Override
    public void clear() {
    }
}
TOP

Related Classes of org.browsermob.proxy.http.BlankCookieStore

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.