Class ResourceFileServlet
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- com.google.apphosting.runtime.jetty94.ResourceFileServlet
-
- All Implemented Interfaces:
Serializable,javax.servlet.Servlet,javax.servlet.ServletConfig
public class ResourceFileServlet extends javax.servlet.http.HttpServletResourceFileServletis a copy oforg.mortbay.jetty.servlet.DefaultServletthat has been trimmed down to only support the subset of features that we want to take advantage of (e.g. no gzipping, no chunked encoding, no buffering, etc.). A number of Jetty-specific optimizations and assumptions have also been removed (e.g. use of custom header manipulation API's, use ofByteArrayBufferinstead of Strings, etc.).A few remaining Jetty-centric details remain, such as use of the
ContextHandler.Contextclass, and Jetty-specific request attributes, but these are specific cases where there is no servlet-engine-neutral API available. This class also uses Jetty'sResourceclass as a convenience, but could be converted to useServletContext.getResource(String)instead.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ResourceFileServlet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)Retrieve the static resource file indicated.protected voiddoPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)protected voiddoTrace(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)voidinit()Initialize the servlet by extracting some useful configuration data from the currentServletContext.protected booleanisProtectedPath(String target)-
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPut, getLastModified, service, service
-
-
-
-
Method Detail
-
init
public void init() throws javax.servlet.ServletExceptionInitialize the servlet by extracting some useful configuration data from the currentServletContext.- Overrides:
initin classjavax.servlet.GenericServlet- Throws:
javax.servlet.ServletException
-
doGet
protected void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOExceptionRetrieve the static resource file indicated.- Overrides:
doGetin classjavax.servlet.http.HttpServlet- Throws:
javax.servlet.ServletExceptionIOException
-
doPost
protected void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException- Overrides:
doPostin classjavax.servlet.http.HttpServlet- Throws:
javax.servlet.ServletExceptionIOException
-
doTrace
protected void doTrace(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException, IOException- Overrides:
doTracein classjavax.servlet.http.HttpServlet- Throws:
javax.servlet.ServletExceptionIOException
-
isProtectedPath
protected boolean isProtectedPath(String target)
-
-