Class ResourceServlet
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- org.torproject.metrics.onionoo.server.ResourceServlet
-
- All Implemented Interfaces:
java.io.Serializable,javax.servlet.Servlet,javax.servlet.ServletConfig
public class ResourceServlet extends javax.servlet.http.HttpServlet- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ResourceServlet()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddoGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)voiddoGet(HttpServletRequestWrapper request, HttpServletResponseWrapper response)voiddoGet(HttpServletRequestWrapper request, HttpServletResponseWrapper response, long receivedRequestMillis)Handles the HTTP GET request in the wrappedrequestby writing an HTTP GET response to the likewiseresponse, both of which are wrapped to facilitate testing.longgetLastModified(javax.servlet.http.HttpServletRequest request)voidinit(javax.servlet.ServletConfig config)protected java.util.Map<java.lang.String,java.lang.String>parseQueryString(java.lang.String queryString)Parse the given query string and return a map with parameter keys and first encountered parameter values.protected static java.lang.String[]parseSearchParameters(java.lang.String parameter)-
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPost, doPut, doTrace, service, service
-
-
-
-
Method Detail
-
init
public void init(javax.servlet.ServletConfig config) throws javax.servlet.ServletException- Specified by:
initin interfacejavax.servlet.Servlet- Overrides:
initin classjavax.servlet.GenericServlet- Throws:
javax.servlet.ServletException
-
getLastModified
public long getLastModified(javax.servlet.http.HttpServletRequest request)
- Overrides:
getLastModifiedin classjavax.servlet.http.HttpServlet
-
doGet
public void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws java.io.IOException- Overrides:
doGetin classjavax.servlet.http.HttpServlet- Throws:
java.io.IOException
-
doGet
public void doGet(HttpServletRequestWrapper request, HttpServletResponseWrapper response) throws java.io.IOException
- Throws:
java.io.IOException
-
doGet
public void doGet(HttpServletRequestWrapper request, HttpServletResponseWrapper response, long receivedRequestMillis) throws java.io.IOException
Handles the HTTP GET request in the wrappedrequestby writing an HTTP GET response to the likewiseresponse, both of which are wrapped to facilitate testing.- Throws:
java.io.IOException
-
parseQueryString
protected java.util.Map<java.lang.String,java.lang.String> parseQueryString(java.lang.String queryString)
Parse the given query string and return a map with parameter keys and first encountered parameter values.- Parameters:
queryString- Query string obtained from the request.- Returns:
- Map with parameter keys and values.
-
parseSearchParameters
protected static java.lang.String[] parseSearchParameters(java.lang.String parameter)
-
-