org.mortbay.jetty.security
Class HTAccessHandler
java.lang.Object
org.mortbay.component.AbstractLifeCycle
org.mortbay.jetty.handler.AbstractHandler
org.mortbay.jetty.handler.AbstractHandlerContainer
org.mortbay.jetty.handler.HandlerWrapper
org.mortbay.jetty.security.SecurityHandler
org.mortbay.jetty.security.HTAccessHandler
- All Implemented Interfaces:
- LifeCycle, Handler, HandlerContainer
public class HTAccessHandler
- extends SecurityHandler
Handler to authenticate access using the Apache's .htaccess files.
- Author:
- Van den Broeke Iris, Deville Daniel, Dubois Roger, Greg Wilkins, Konstantin Metlov
Methods inherited from class org.mortbay.jetty.security.SecurityHandler |
checkSecurityConstraints, doStart, getAuthenticator, getAuthMethod, getConstraintMappings, getUserRealm, hasConstraints, isCheckWelcomeFiles, setAuthenticator, setAuthMethod, setCheckWelcomeFiles, setConstraintMappings, setUserRealm |
HTAccessHandler
public HTAccessHandler()
handle
public void handle(String target,
HttpServletRequest request,
HttpServletResponse response,
int dispatch)
throws IOException,
ServletException
- Handle a request.
- Specified by:
handle
in interface Handler
- Overrides:
handle
in class SecurityHandler
- Parameters:
target
- The target of the request - either a URI or a name.request
- The request either as the Request
object or a wrapper of that request. The HttpConnection.getCurrentConnection()
method can be used access the Request object if required.response
- The response as the Response
object or a wrapper of that request. The HttpConnection.getCurrentConnection()
method can be used access the Response object if required.dispatch
- The dispatch mode: Handler.REQUEST
, Handler.FORWARD
, Handler.INCLUDE
, Handler.ERROR
- Throws:
IOException
ServletException
- See Also:
Handler.handle(java.lang.String,
javax.servlet.http.HttpServletRequest,
javax.servlet.http.HttpServletResponse, int)
getPrincipal
public Principal getPrincipal(String user,
UserRealm realm)
- Get a Principal matching the user.
If there is no user realm, and therefore we are using a
htpassword file instead, then just return a dummy Principal.
- Parameters:
user
- realm
-
- Returns:
setDefault
public void setDefault(String dir)
- set functions for the following .xml administration statements.
./etc/htaccess .htaccess
setAccessFile
public void setAccessFile(String anArg)
getProtegee
protected Handler getProtegee()
- Getter for property protegee.
- Returns:
- Returns the protegee.
setProtegee
public void setProtegee(Handler protegee)
- Setter for property protegee.
- Parameters:
protegee
- The protegee to set.