Using HttpCookieStore.Empty from jetty-util instead

This commit is contained in:
Joakim Erdfelt 2013-01-30 09:56:09 -07:00
parent 5e8aa4eeb3
commit f46ad8bbab
2 changed files with 2 additions and 78 deletions

View File

@ -1,77 +0,0 @@
//
// ========================================================================
// Copyright (c) 1995-2013 Mort Bay Consulting Pty. Ltd.
// ------------------------------------------------------------------------
// All rights reserved. This program and the accompanying materials
// are made available under the terms of the Eclipse Public License v1.0
// and Apache License v2.0 which accompanies this distribution.
//
// The Eclipse Public License is available at
// http://www.eclipse.org/legal/epl-v10.html
//
// The Apache License v2.0 is available at
// http://www.opensource.org/licenses/apache2.0.php
//
// You may elect to redistribute this code under either of these licenses.
// ========================================================================
//
package org.eclipse.jetty.websocket.client;
import java.net.CookieStore;
import java.net.HttpCookie;
import java.net.URI;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
/**
* An empty implementation of the CookieStore
*/
public class EmptyCookieStore implements CookieStore
{
private final List<HttpCookie> nocookies;
private final List<URI> nouris;
public EmptyCookieStore()
{
nocookies = Collections.unmodifiableList(new ArrayList<HttpCookie>());
nouris = Collections.unmodifiableList(new ArrayList<URI>());
}
@Override
public void add(URI uri, HttpCookie cookie)
{
/* do nothing */
}
@Override
public List<HttpCookie> get(URI uri)
{
return nocookies;
}
@Override
public List<HttpCookie> getCookies()
{
return nocookies;
}
@Override
public List<URI> getURIs()
{
return nouris;
}
@Override
public boolean remove(URI uri, HttpCookie cookie)
{
return false;
}
@Override
public boolean removeAll()
{
return false;
}
}

View File

@ -30,6 +30,7 @@ import java.util.concurrent.Future;
import org.eclipse.jetty.io.ByteBufferPool;
import org.eclipse.jetty.io.MappedByteBufferPool;
import org.eclipse.jetty.util.HttpCookieStore;
import org.eclipse.jetty.util.StringUtil;
import org.eclipse.jetty.util.component.ContainerLifeCycle;
import org.eclipse.jetty.util.log.Log;
@ -175,7 +176,7 @@ public class WebSocketClient extends ContainerLifeCycle
if (cookieStore == null)
{
cookieStore = new EmptyCookieStore();
cookieStore = new HttpCookieStore.Empty();
}
this.connectionManager = new ConnectionManager(this);