org.benow.web.path.captcha
Class CaptchaPathHandler

java.lang.Object
  extended by org.benow.web.path.PathHandler
      extended by org.benow.web.path.captcha.CaptchaPathHandler

public class CaptchaPathHandler
extends PathHandler


Field Summary
static org.benow.security.permission.Permission PERMISSION_CAPTCHA_NOT_REQUIRED
           
 
Fields inherited from class org.benow.web.path.PathHandler
CONTENT_LENGTH_UNKNOWN, LAST_MODIFIED_UNKNOWN, params, request, response
 
Constructor Summary
CaptchaPathHandler()
           
 
Method Summary
static void assertValid(java.lang.String captcha)
           
 boolean canHandle(java.lang.String path)
          Return true if the handler can handle the given path.
 java.lang.Object handle(java.io.OutputStream out)
           
static boolean validate(javax.servlet.http.HttpSession session, java.lang.String given)
           
static boolean validate(java.lang.String captcha)
           
 
Methods inherited from class org.benow.web.path.PathHandler
deliverHTML, deliverStream, deliverStream, deliverStream, handle, handle, handle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PERMISSION_CAPTCHA_NOT_REQUIRED

public static final org.benow.security.permission.Permission PERMISSION_CAPTCHA_NOT_REQUIRED
Constructor Detail

CaptchaPathHandler

public CaptchaPathHandler()
Method Detail

canHandle

public boolean canHandle(java.lang.String path)
Description copied from class: PathHandler
Return true if the handler can handle the given path. Path is in format /dir/childdir/item.ext. It will never be null and will always start with a /.

Specified by:
canHandle in class PathHandler
Returns:

handle

public java.lang.Object handle(java.io.OutputStream out)
                        throws java.lang.Exception
Overrides:
handle in class PathHandler
Throws:
java.lang.Exception

validate

public static boolean validate(javax.servlet.http.HttpSession session,
                               java.lang.String given)

validate

public static boolean validate(java.lang.String captcha)

assertValid

public static void assertValid(java.lang.String captcha)
                        throws InvalidCaptchaException
Throws:
InvalidCaptchaException