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

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

Introduction

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

Prototype

@Deprecated
String getComment();

Source Link

Usage

From source file:com.mastfrog.acteur.wicket.adapters.CookieConverter.java

License:Open Source License

@Override
public Cookie unconvert(javax.servlet.http.Cookie t) {
    if (t instanceof CookieAdapter) {
        return ((CookieAdapter) t).cookie;
    } else {//  w  w w  .ja  v  a2  s  .  co  m
        DefaultCookie dc = new DefaultCookie(t.getName(), t.getValue());
        dc.setComment(t.getComment());
        dc.setMaxAge(t.getMaxAge());
        dc.setDomain(t.getDomain());
        dc.setVersion(t.getVersion());
        return dc;
    }
}

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++;// ww  w  .  ja va 2  s  . c o m
            }
            return cookiesArray;

        }
    }
    return new Cookie[0];
}