net.i2p.servlet

## Class I2PDefaultServlet

- java.lang.Object
- - javax.servlet.GenericServlet
  - - javax.servlet.http.HttpServlet
    - - org.eclipse.jetty.servlet.DefaultServlet
      - - net.i2p.servlet.I2PDefaultServlet

- All Implemented Interfaces:
    Serializable, Servlet, ServletConfig, ResourceFactory

      public class I2PDefaultServlet
      extends DefaultServlet

  Extends DefaultServlet to set locale for the displayed time of directory listings, to prevent leaking of the locale.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `I2PDefaultServlet()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected void` | `doGet(HttpServletRequest request, HttpServletResponse response)`
    `Resource` | `getResource(String path)`
    `void` | `init()` Overridden to save local copies of dirAllowed, locale, resourceBase, and stylesheet.
    `protected ContextHandler` | `initContextHandler(ServletContext servletContext)` Overridden to save the result Calls super.
    `protected void` | `sendDirectory(HttpServletRequest request, HttpServletResponse response, Resource resource, String pathInContext)` Copied and modified from DefaultServlet.java.

    - ### Methods inherited from class org.eclipse.jetty.servlet.DefaultServlet

      `destroy, doOptions, doPost, doTrace, getInitParameter, isGzippedContent, passConditionalHeaders, putHeaders, sendData, sendWelcome`

    - ### Methods inherited from class javax.servlet.http.HttpServlet

      `doDelete, doHead, doPut, getLastModified, service, service`

    - ### Methods inherited from class javax.servlet.GenericServlet

      `getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### I2PDefaultServlet

          public I2PDefaultServlet()

  - ### Method Detail

    - #### doGet

          protected void doGet(HttpServletRequest request,
                               HttpServletResponse response)
                        throws ServletException,
                               IOException

      Overrides:
        `doGet` in class `DefaultServlet`
      Throws:
        `ServletException`
        `IOException`

    - #### getResource

          public Resource getResource(String path)

      Specified by:
        `getResource` in interface `ResourceFactory`
      Overrides:
        `getResource` in class `DefaultServlet`

    - #### init

          public void init()
                    throws UnavailableException

      Overridden to save local copies of dirAllowed, locale, resourceBase, and stylesheet. Calls super.
      Overrides:
        `init` in class `DefaultServlet`
      Throws:
        `UnavailableException`

    - #### initContextHandler

          protected ContextHandler initContextHandler(ServletContext servletContext)

      Overridden to save the result Calls super.
      Overrides:
        `initContextHandler` in class `DefaultServlet`

    - #### sendDirectory

          protected void sendDirectory(HttpServletRequest request,
                                       HttpServletResponse response,
                                       Resource resource,
                                       String pathInContext)
                                throws IOException

      Copied and modified from DefaultServlet.java. Overridden to set the Locale for the dates. Get the resource list as a HTML directory listing.
      Overrides:
        `sendDirectory` in class `DefaultServlet`
      Throws:
        `IOException`