Introduced HttpCookieStore.Empty to disable cookies in HttpClient and in the websocket client.
This commit is contained in:
parent
756b13700b
commit
0ff769e633
|
@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue