private void dumpCookies ( Map < String , Cookie > cookiesMap , String maskKey ) { cookiesMap . forEach ( ( key , cookie ) -> { if ( ! config . getRequestFilteredCookies ( ) . contains ( cookie . getName ( ) ) ) { List < Map < String , String > > cookieInfoList = new ArrayList <> ( ) ; //mask cookieValue String cookieValue = config . isMaskEnabled ( ) ? Mask . maskRegex ( cookie . getValue ( ) , maskKey , cookie . getName ( ) ) : cookie . getValue ( ) ; cookieInfoList . add ( new HashMap < String , String > ( ) { { put ( DumpConstants . COOKIE_VALUE , cookieValue ) ; } } ) ; cookieInfoList . add ( new HashMap < String , String > ( ) { { put ( DumpConstants . COOKIE_DOMAIN , cookie . getDomain ( ) ) ; } } ) ; cookieInfoList . add ( new HashMap < String , String > ( ) { { put ( DumpConstants . COOKIE_PATH , cookie . getPath ( ) ) ; } } ) ; cookieInfoList . add ( new HashMap < String , String > ( ) { { put ( DumpConstants . COOKIE_EXPIRES , cookie . getExpires ( ) == null ? "" : cookie . getExpires ( ) . toString ( ) ) ; } } ) ; this . cookieMap . put ( key , cookieInfoList ) ; } } ) ; }
put cookies info to cookieMap