org.klomp.snark.web
Class I2PSnarkServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by org.mortbay.jetty.servlet.Default
              extended by org.klomp.snark.web.I2PSnarkServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class I2PSnarkServlet
extends org.mortbay.jetty.servlet.Default

We extend Default instead of HTTPServlet so we can handle i2psnark/ file requests with http:// instead of the flaky and often-blocked-by-the-browser file://

See Also:
Serialized Form

Field Summary
static java.lang.String PROP_CONFIG_FILE
           
 
Constructor Summary
I2PSnarkServlet()
           
 
Method Summary
 void destroy()
           
protected  org.mortbay.util.Resource getResource(java.lang.String pathInContext)
          We override this instead of passing a resource base to super(), because if a resource base is set, super.getResource() always uses that base, and we can't get any resources (like icons) out of the .war
 void init(javax.servlet.ServletConfig cfg)
           
 void service(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
          Some parts modified from: // ======================================================================== // $Id: Default.java,v 1.51 2006/10/08 14:13:18 gregwilkins Exp $ // Copyright 199-2004 Mort Bay Consulting Pty.
 
Methods inherited from class org.mortbay.jetty.servlet.Default
handleDelete, handleGet, handleMove, handleOptions, handlePut, init, passConditionalHeaders, sendData, sendDirectory, writeHeaders
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
 
Methods inherited from class javax.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROP_CONFIG_FILE

public static final java.lang.String PROP_CONFIG_FILE
See Also:
Constant Field Values
Constructor Detail

I2PSnarkServlet

public I2PSnarkServlet()
Method Detail

init

public void init(javax.servlet.ServletConfig cfg)
          throws javax.servlet.ServletException
Specified by:
init in interface javax.servlet.Servlet
Overrides:
init in class javax.servlet.GenericServlet
Throws:
javax.servlet.ServletException

destroy

public void destroy()
Specified by:
destroy in interface javax.servlet.Servlet
Overrides:
destroy in class javax.servlet.GenericServlet

getResource

protected org.mortbay.util.Resource getResource(java.lang.String pathInContext)
                                         throws java.io.IOException
We override this instead of passing a resource base to super(), because if a resource base is set, super.getResource() always uses that base, and we can't get any resources (like icons) out of the .war

Overrides:
getResource in class org.mortbay.jetty.servlet.Default
Throws:
java.io.IOException

service

public void service(javax.servlet.http.HttpServletRequest req,
                    javax.servlet.http.HttpServletResponse resp)
             throws javax.servlet.ServletException,
                    java.io.IOException
Some parts modified from:
      // ========================================================================
      // $Id: Default.java,v 1.51 2006/10/08 14:13:18 gregwilkins Exp $
      // Copyright 199-2004 Mort Bay Consulting Pty. Ltd.
      // ------------------------------------------------------------------------
      // Licensed under the Apache License, Version 2.0 (the "License");
      // you may not use this file except in compliance with the License.
      // You may obtain a copy of the License at 
      // http://www.apache.org/licenses/LICENSE-2.0
      // Unless required by applicable law or agreed to in writing, software
      // distributed under the License is distributed on an "AS IS" BASIS,
      // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      // See the License for the specific language governing permissions and
      // limitations under the License.
      // ========================================================================
 

Overrides:
service in class org.mortbay.jetty.servlet.Default
Throws:
javax.servlet.ServletException
java.io.IOException