## 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

Nested Class Summary

Nested classes/interfaces inherited from class org.mortbay.jetty.security.SecurityHandler
`SecurityHandler.NotChecked`

Field Summary

Fields inherited from class org.mortbay.jetty.security.SecurityHandler
`__NO_USER, __NOBODY`

Fields inherited from class org.mortbay.jetty.handler.AbstractHandler
`_string`

Fields inherited from interface org.mortbay.jetty.Handler
`ALL, DEFAULT, ERROR, FORWARD, INCLUDE, REQUEST`

Constructor Summary
`HTAccessHandler()`

Method Summary
`Principal` `getPrincipal(String user, UserRealm realm)` Get a Principal matching the user.
`protected Handler` `getProtegee()` Getter for property protegee.
`void` `handle(String target, HttpServletRequest request, HttpServletResponse response, int dispatch)` Handle a request.
`void` `setAccessFile(String anArg)`
`void` `setDefault(String dir)` set functions for the following .xml administration statements.
`void` `setProtegee(Handler protegee)` Setter for property protegee.

Methods inherited from class org.mortbay.jetty.security.SecurityHandler
`checkSecurityConstraints, doStart, getAuthenticator, getAuthMethod, getConstraintMappings, getUserRealm, hasConstraints, isCheckWelcomeFiles, setAuthenticator, setAuthMethod, setCheckWelcomeFiles, setConstraintMappings, setUserRealm`

Methods inherited from class org.mortbay.jetty.handler.HandlerWrapper
`addHandler, doStop, expandChildren, getHandler, setHandler, setServer`

Methods inherited from class org.mortbay.jetty.handler.AbstractHandlerContainer
`expandHandler, getChildHandlerByClass, getChildHandlers, getChildHandlersByClass`

Methods inherited from class org.mortbay.jetty.handler.AbstractHandler
`destroy, getServer, toString`

Methods inherited from class org.mortbay.component.AbstractLifeCycle
`isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, start, stop`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Methods inherited from interface org.mortbay.component.LifeCycle
`isFailed, isRunning, isStarted, isStarting, isStopped, isStopping, start, stop`

Constructor Detail

### HTAccessHandler

    public HTAccessHandler()

Method Detail

### 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. <Arg> ./etc/htaccess .htaccess </Arg>

### 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.

Copyright © 2007 Mort Bay Consulting. All Rights Reserved.