org.klomp.snark.web
Class I2PSnarkServlet
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.mortbay.jetty.servlet.DefaultServlet
org.klomp.snark.web.I2PSnarkServlet
- All Implemented Interfaces:
- Serializable, Servlet, ServletConfig, org.mortbay.resource.ResourceFactory
public class I2PSnarkServlet
- extends DefaultServlet
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
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PROP_CONFIG_FILE
public static final String PROP_CONFIG_FILE
- See Also:
- Constant Field Values
I2PSnarkServlet
public I2PSnarkServlet()
init
public void init(ServletConfig cfg)
throws ServletException
- Specified by:
init
in interface Servlet
- Overrides:
init
in class GenericServlet
- Throws:
ServletException
destroy
public void destroy()
- Specified by:
destroy
in interface Servlet
- Overrides:
destroy
in class DefaultServlet
getResource
public org.mortbay.resource.Resource getResource(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
- Specified by:
getResource
in interface org.mortbay.resource.ResourceFactory
- Overrides:
getResource
in class DefaultServlet
doGet
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException,
IOException
- Tell the browser to cache the icons
- Overrides:
doGet
in class DefaultServlet
- Throws:
ServletException
IOException
- Since:
- 0.8.3
service
public void service(HttpServletRequest req,
HttpServletResponse resp)
throws ServletException,
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 HttpServlet
- Throws:
ServletException
IOException
urlify
static String urlify(String s)
- Since:
- 0.7.14