private String getCookieParam ( String param , String cookieString ) { if ( param . equals ( NAME ) ) { return cookieString . substring ( 0 , cookieString . indexOf ( ' ' ) ) ; } if ( param . equals ( VALUE ) ) { if ( cookieString . contains ( ";" ) ) { return cookieString . substring ( cookieString . indexOf ( ' ' ) + 1 , cookieString . indexOf ( ' ' ) ) ; } else { return cookieString . substring ( cookieString . indexOf ( ' ' ) + 1 ) ; } } if ( containsFlag ( SECURE , param , cookieString ) || containsFlag ( HTTP_ONLY , param , cookieString ) ) { return String . valueOf ( true ) ; } if ( cookieString . contains ( param + ' ' ) ) { final int endParam = cookieString . indexOf ( ' ' , cookieString . indexOf ( param + ' ' ) ) ; final int beginIndex = cookieString . indexOf ( param + ' ' ) + param . length ( ) + 1 ; if ( endParam > 0 ) { return cookieString . substring ( beginIndex , endParam ) ; } else { return cookieString . substring ( beginIndex ) ; } } throw new CitrusRuntimeException ( String . format ( "Unable to get cookie argument '%s' from cookie String: %s" , param , cookieString ) ) ; }
Extract cookie param from cookie string as it was provided by Set - Cookie header .