private static String convertV0Cookie ( HttpCookie cookie ) { StringBuilder buffer = new StringBuilder ( 40 ) ; // Append name=value buffer . append ( cookie . getName ( ) ) ; String value = cookie . getValue ( ) ; if ( null != value && 0 != value . length ( ) ) { buffer . append ( ' ' ) ; buffer . append ( value ) ; } else { // PK48196 - send an empty value string buffer . append ( "=\"\"" ) ; } // check for optional path value = cookie . getPath ( ) ; if ( null != value && 0 != value . length ( ) ) { buffer . append ( "; $Path=" ) ; buffer . append ( value ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Created v0 Cookie: [" + buffer . toString ( ) + "]" ) ; } return buffer . toString ( ) ; }
Convert the V0 Cookie into a Cookie header string .