public static Cookie convertNettyCookieToWisdomCookie ( DefaultCookie cookie ) { Preconditions . checkNotNull ( cookie ) ; String value = cookie . value ( ) ; // // Netty append some data at the end f the cookie: // // -createdBy=wisdom&at=3+nov.+2013+11%3A52%3A15&___TS=1383475935779, path=/, maxAge=3600s, secure, HTTPOnly // // We have to remove them // // TODO Do we really need this ? It was probably related to the cookie encoding issue. // if (value.contains(PATH)) { // value = value.substring(0, value.indexOf(PATH)); // } Cookie . Builder builder = Cookie . builder ( cookie . name ( ) , value ) ; builder . setMaxAge ( cookie . maxAge ( ) ) ; if ( cookie . domain ( ) != null ) { builder . setDomain ( cookie . domain ( ) ) ; } builder . setSecure ( cookie . isSecure ( ) ) ; if ( cookie . path ( ) != null ) { builder . setPath ( cookie . path ( ) ) ; } builder . setHttpOnly ( cookie . isHttpOnly ( ) ) ; return builder . build ( ) ; }
Converts the Netty s cookie to a Wisdom s cookie .