Code example for MalformedChallengeException

0
	public void processChallenge(final Header header)
			throws MalformedChallengeException { 
		super.processChallenge(header);
 
		if (getParameter("realm") == null) {
			throw new MalformedChallengeException("missing realm in challenge");
		} 
		if (getParameter("nonce") == null) {
			throw new MalformedChallengeException("missing nonce in challenge");
		} 
		this.complete = true;
	} 
 
	/** 
	 * Tests if the Digest authentication process has been completed. 
	 *  
	 * @return <tt>true</tt> if Digest authorization has been processed, 
	 *         <tt>false</tt> otherwise. 
	 */ 
	public boolean isComplete() { 
		String s = getParameter("stale");