Remove the references to the deprecated CookieDecoder

This commit is contained in:
Trustin Lee 2015-01-21 22:31:06 +09:00
parent 7d102084c1
commit 0fc097cb20
4 changed files with 13 additions and 11 deletions

View File

@ -23,13 +23,14 @@ package io.netty.handler.codec.http;
* <p>
* Unlike the Servlet API, a query string is constructed and decomposed by
* {@link QueryStringEncoder} and {@link QueryStringDecoder}. {@link Cookie}
* support is also provided separately via {@link CookieDecoder}, {@link ClientCookieEncoder},
* and {@link @ServerCookieEncoder}.
* support is also provided separately via {@link ClientCookieDecoder}, {@link ServerCookieDecoder},
* {@link ClientCookieEncoder}, and {@link @ServerCookieEncoder}.
*
* @see HttpResponse
* @see ClientCookieEncoder
* @see ServerCookieEncoder
* @see CookieDecoder
* @see ClientCookieDecoder
* @see ServerCookieDecoder
*/
public interface HttpRequest extends HttpMessage {

View File

@ -21,13 +21,14 @@ package io.netty.handler.codec.http;
*
* <h3>Accessing Cookies</h3>
* <p>
* Unlike the Servlet API, {@link Cookie} support is provided separately via {@link CookieDecoder},
* {@link ClientCookieEncoder}, and {@link ServerCookieEncoder}.
* Unlike the Servlet API, {@link Cookie} support is provided separately via {@link ClientCookieDecoder},
* {@link ServerCookieDecoder}, {@link ClientCookieEncoder}, and {@link @ServerCookieEncoder}.
*
* @see HttpRequest
* @see CookieDecoder
* @see ClientCookieEncoder
* @see ServerCookieEncoder
* @see ClientCookieDecoder
* @see ServerCookieDecoder
*/
public interface HttpResponse extends HttpMessage {

View File

@ -22,7 +22,6 @@ import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import io.netty.handler.codec.DecoderResult;
import io.netty.handler.codec.http.Cookie;
import io.netty.handler.codec.http.CookieDecoder;
import io.netty.handler.codec.http.DefaultFullHttpResponse;
import io.netty.handler.codec.http.FullHttpResponse;
import io.netty.handler.codec.http.HttpContent;
@ -34,6 +33,7 @@ import io.netty.handler.codec.http.HttpObject;
import io.netty.handler.codec.http.HttpRequest;
import io.netty.handler.codec.http.LastHttpContent;
import io.netty.handler.codec.http.QueryStringDecoder;
import io.netty.handler.codec.http.ServerCookieDecoder;
import io.netty.handler.codec.http.ServerCookieEncoder;
import io.netty.util.CharsetUtil;
@ -165,7 +165,7 @@ public class HttpSnoopServerHandler extends SimpleChannelInboundHandler<Object>
// Encode the cookie.
String cookieString = request.headers().get(HttpHeaderNames.COOKIE);
if (cookieString != null) {
Set<Cookie> cookies = CookieDecoder.decode(cookieString);
Set<Cookie> cookies = ServerCookieDecoder.decode(cookieString);
if (!cookies.isEmpty()) {
// Reset the cookies if necessary.
for (Cookie cookie: cookies) {

View File

@ -22,7 +22,6 @@ import io.netty.channel.ChannelFutureListener;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.SimpleChannelInboundHandler;
import io.netty.handler.codec.http.Cookie;
import io.netty.handler.codec.http.CookieDecoder;
import io.netty.handler.codec.http.DefaultFullHttpResponse;
import io.netty.handler.codec.http.FullHttpResponse;
import io.netty.handler.codec.http.HttpContent;
@ -36,6 +35,7 @@ import io.netty.handler.codec.http.HttpResponseStatus;
import io.netty.handler.codec.http.HttpVersion;
import io.netty.handler.codec.http.LastHttpContent;
import io.netty.handler.codec.http.QueryStringDecoder;
import io.netty.handler.codec.http.ServerCookieDecoder;
import io.netty.handler.codec.http.ServerCookieEncoder;
import io.netty.handler.codec.http.multipart.Attribute;
import io.netty.handler.codec.http.multipart.DefaultHttpDataFactory;
@ -125,7 +125,7 @@ public class HttpUploadServerHandler extends SimpleChannelInboundHandler<HttpObj
if (value == null) {
cookies = Collections.emptySet();
} else {
cookies = CookieDecoder.decode(value);
cookies = ServerCookieDecoder.decode(value);
}
for (Cookie cookie : cookies) {
responseContent.append("COOKIE: " + cookie + "\r\n");
@ -308,7 +308,7 @@ public class HttpUploadServerHandler extends SimpleChannelInboundHandler<HttpObj
if (value == null) {
cookies = Collections.emptySet();
} else {
cookies = CookieDecoder.decode(value);
cookies = ServerCookieDecoder.decode(value);
}
if (!cookies.isEmpty()) {
// Reset the cookies if necessary.