org.benow.web.path.captcha
Class CaptchaPathHandler
java.lang.Object
org.benow.web.path.PathHandler
org.benow.web.path.captcha.CaptchaPathHandler
public class CaptchaPathHandler
- extends PathHandler
|
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 java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PERMISSION_CAPTCHA_NOT_REQUIRED
public static final org.benow.security.permission.Permission PERMISSION_CAPTCHA_NOT_REQUIRED
CaptchaPathHandler
public CaptchaPathHandler()
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