common/src/main/java/HTTPClient/RetryModule.java
/**
     * Add a token to the given header. If the header does not exist then
     * create it with the given token.
     *
     * @param req the request who's headers are to be modified
     * @param hdr the name of the header to add the token to (or to create)
     * @param tok the token to add
     * @exception ParseException if parsing the header fails
     */
Add a token to the given header. If the header does not exist then
create it with the given token.

@param req the request who's headers are to be modified
@param hdr the name of the header to add the token to (or to create)
@param tok the token to add
@exception ParseException if parsing the header fails
Add a token to the given header . If the header does not exist then create it with the given token . @param req the request who ' s headers are to be modified @param hdr the name of the header to add the token to ( or to create ) @param tok the token to add @exception ParseException if parsing the header fails
private void addToken(Request req, String hdr, String tok)
	    throws ParseException
    {
	int idx;
	NVPair[] hdrs = req.getHeaders();
	for (idx=0; idx<hdrs.length; idx++)
	{
	    if (hdrs[idx].getName().equalsIgnoreCase(hdr))
		break;
	}
	if (idx == hdrs.length)		
	{
	    hdrs = Util.resizeArray(hdrs, idx+1);
	    hdrs[idx] = new NVPair(hdr, tok);
	    req.setHeaders(hdrs);
	}
	else					
	{
	    if (!Util.hasToken(hdrs[idx].getValue(), tok))
		hdrs[idx] = new NVPair(hdr, hdrs[idx].getValue() + ", " + tok);
	}
    }
private void addToken ( Request req , String hdr , String tok ) throws ParseException { int idx ; NVPair [ ] hdrs = req . getHeaders ( ) ; for ( idx = 0 ; idx < hdrs . length ; idx ++ ) { if ( hdrs [ idx ] . getName ( ) . equalsIgnoreCase ( hdr ) ) break ; } if ( idx == hdrs . length ) { hdrs = Util . resizeArray ( hdrs , idx + 1 ) ; hdrs [ idx ] = new NVPair ( hdr , tok ) ; req . setHeaders ( hdrs ) ; } else { if ( ! Util . hasToken ( hdrs [ idx ] . getValue ( ) , tok ) ) hdrs [ idx ] = new NVPair ( hdr , hdrs [ idx ] . getValue ( ) + ", " + tok ) ; } }
Add a token to the given header.
Add a token to the given header .
// no such header, so add one // header exists, so add token