public class I2PSnarkServlet extends BasicServlet
This servlet provides the complete web-based user interface for I2PSnark, allowing users to manage their torrents through a browser. It handles:
The servlet has been refactored to eliminate Jetty-specific dependencies and works with standard servlet containers.
Security features include:
BasicServlet.HttpContent| Modifier and Type | Field and Description |
|---|---|
(package private) String |
cspNonce |
(package private) static char |
HELLIP |
(package private) static int |
MAX_DISPLAYED_FILENAME_LENGTH |
static String |
PROP_CONFIG_FILE |
static String |
WARBASE |
_context, _log, _resourceBase| Constructor and Description |
|---|
I2PSnarkServlet() |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy() |
void |
doGet(HttpServletRequest request,
HttpServletResponse response)
Handle what we can here, calling super.doGet() for the rest.
|
void |
doPost(HttpServletRequest request,
HttpServletResponse response)
Handle what we can here, calling super.doPost() for the rest.
|
File |
getResource(String pathInContext)
We override this to set the file relative to the storage directory
for the torrent.
|
void |
init(ServletConfig cfg) |
boolean |
isAdvanced() |
(package private) String |
toIcon(String path)
Returns the icon name representing the file type or mime type of the given file path.
|
(package private) static String |
urlify(String s)
This is for a full URL.
|
boolean |
useSoraFont() |
addMimeMapping, addPaths, decodePath, doDelete, doOptions, doTrace, encodePath, getContent, getMimeType, loadMimeMap, passConditionalHeaders, sendData, setResourceBase, setWarBase, writeHeadersdoHead, doPut, getLastModified, service, servicegetInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, logString cspNonce
static final char HELLIP
static final int MAX_DISPLAYED_FILENAME_LENGTH
public static final String PROP_CONFIG_FILE
public static final String WARBASE
public void destroy()
destroy in interface Servletdestroy in class GenericServletpublic void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
doGet in class BasicServletServletExceptionIOExceptionpublic void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
doPost in class BasicServletServletExceptionIOExceptionpublic File getResource(String pathInContext)
getResource in class BasicServletpathInContext - should always start with /public void init(ServletConfig cfg) throws ServletException
init in interface Servletinit in class BasicServletServletExceptionpublic boolean isAdvanced()
String toIcon(String path)
path - the file path or file name to analyzepublic boolean useSoraFont()