Introduced HttpCookieStore.Empty to disable cookies in HttpClient and in the websocket client.

This commit is contained in:
Simone Bordet 2012-12-12 18:35:10 +01:00
parent 756b13700b
commit 0ff769e633
1 changed files with 39 additions and 0 deletions

View File

@ -22,6 +22,7 @@ import java.net.CookieManager;
import java.net.CookieStore;
import java.net.HttpCookie;
import java.net.URI;
import java.util.Collections;
import java.util.List;
/**
@ -72,4 +73,42 @@ public class HttpCookieStore implements CookieStore
{
return delegate.removeAll();
}
public static class Empty implements CookieStore
{
@Override
public void add(URI uri, HttpCookie cookie)
{
}
@Override
public List<HttpCookie> get(URI uri)
{
return Collections.emptyList();
}
@Override
public List<HttpCookie> getCookies()
{
return Collections.emptyList();
}
@Override
public List<URI> getURIs()
{
return Collections.emptyList();
}
@Override
public boolean remove(URI uri, HttpCookie cookie)
{
return false;
}
@Override
public boolean removeAll()
{
return false;
}
}
}