org.klomp.snark.web
Class I2PSnarkServlet
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
org.klomp.snark.web.BasicServlet
org.klomp.snark.web.I2PSnarkServlet
- All Implemented Interfaces:
- Serializable, Servlet, ServletConfig
public class I2PSnarkServlet
- extends BasicServlet
Refactored to eliminate Jetty dependencies.
- See Also:
- Serialized Form
Methods inherited from class org.klomp.snark.web.BasicServlet |
addMimeMapping, addPaths, decodePath, doDelete, doOptions, doTrace, encodePath, getContent, getMimeType, loadMimeMap, passConditionalHeaders, sendData, setResourceBase, setWarBase, writeHeaders |
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 BasicServlet
- Throws:
ServletException
destroy
public void destroy()
- Specified by:
destroy
in interface Servlet
- Overrides:
destroy
in class GenericServlet
getResource
public File getResource(String pathInContext)
- We override this to set the file relative to the storage dirctory
for the torrent.
- Overrides:
getResource
in class BasicServlet
- Parameters:
pathInContext
- should always start with /
- Returns:
- The resource to serve or null if not existing
doGet
public void doGet(HttpServletRequest request,
HttpServletResponse response)
throws ServletException,
IOException
- Handle what we can here, calling super.doGet() for the rest.
- Overrides:
doGet
in class BasicServlet
- Throws:
ServletException
IOException
- Since:
- 0.8.3
doPost
public void doPost(HttpServletRequest request,
HttpServletResponse response)
throws ServletException,
IOException
- Handle what we can here, calling super.doPost() for the rest.
- Overrides:
doPost
in class BasicServlet
- Throws:
ServletException
IOException
- Since:
- Jetty 7
urlify
static String urlify(String s)
- This is for a full URL. For a path only, use encodePath().
- Since:
- 0.7.14
toIcon
String toIcon(String path)
- Pick an icon; try to catch the common types in an i2p environment
Pkg private for FileTypeSorter.
- Returns:
- file name not including ".png"
- Since:
- 0.7.14