Code example for AuthenticationException

0
            HashMap<String, String> directivesMap, String directive,
            boolean mandatory) throws AuthenticationException {
        String value = directivesMap.get(directive);
        if (value == null) {
            if (mandatory) {
                throw new AuthenticationException("\"" + directive
                        + "\" mandatory directive is missing"); 
            } 
 
            return ""; 
        } 
 
        return value;
    } 
 
    /** 
     * Copy the directive to the {@link StringBuilder} if not null. 
     * (A directive is a parameter of the digest authentication process.) 
     *  
     * @param directives the directives map