Example usage for io.netty.handler.codec.http Cookie setComment

List of usage examples for io.netty.handler.codec.http Cookie setComment

Introduction

In this page you can find the example usage for io.netty.handler.codec.http Cookie setComment.

Prototype

@Deprecated
void setComment(String comment);

Source Link

Document

Sets the comment of this Cookie .

Usage

From source file:io.nebo.container.NettyHttpServletRequest.java

License:Apache License

@Override
public Cookie[] getCookies() {
    String cookieString = this.request.headers().get(COOKIE);
    if (cookieString != null) {
        Set<io.netty.handler.codec.http.Cookie> cookies = CookieDecoder.decode(cookieString);
        if (!cookies.isEmpty()) {
            Cookie[] cookiesArray = new Cookie[cookies.size()];
            int index = 0;
            for (io.netty.handler.codec.http.Cookie c : cookies) {
                Cookie cookie = new Cookie(c.getName(), c.getValue());
                cookie.setComment(c.getComment());
                if (c.getDomain() != null)
                    cookie.setDomain(c.getDomain());
                cookie.setMaxAge((int) c.getMaxAge());
                cookie.setPath(c.getPath());
                cookie.setSecure(c.isSecure());
                cookie.setVersion(c.getVersion());
                cookiesArray[index] = cookie;
                index++;//from w  ww  .  j  av  a 2  s  .c  o  m
            }
            return cookiesArray;

        }
    }
    return new Cookie[0];
}