private Cookie convertCookieString ( String cookieString ) { Cookie cookie = new Cookie ( getCookieParam ( NAME , cookieString ) , getCookieParam ( VALUE , cookieString ) ) ; if ( cookieString . contains ( COMMENT ) ) { cookie . setComment ( getCookieParam ( COMMENT , cookieString ) ) ; } if ( cookieString . contains ( PATH ) ) { cookie . setPath ( getCookieParam ( PATH , cookieString ) ) ; } if ( cookieString . contains ( DOMAIN ) ) { cookie . setDomain ( getCookieParam ( DOMAIN , cookieString ) ) ; } if ( cookieString . contains ( MAX_AGE ) ) { cookie . setMaxAge ( Integer . valueOf ( getCookieParam ( MAX_AGE , cookieString ) ) ) ; } if ( cookieString . contains ( SECURE ) ) { cookie . setSecure ( Boolean . valueOf ( getCookieParam ( SECURE , cookieString ) ) ) ; } if ( cookieString . contains ( VERSION ) ) { cookie . setVersion ( Integer . valueOf ( getCookieParam ( VERSION , cookieString ) ) ) ; } if ( cookieString . contains ( HTTP_ONLY ) ) { cookie . setHttpOnly ( Boolean . valueOf ( getCookieParam ( HTTP_ONLY , cookieString ) ) ) ; } return cookie ; }
Converts a cookie string from a http header value into a Cookie object