net.stepniak.api.utils
Class StaticServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by net.stepniak.api.utils.StaticServlet
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class StaticServlet
extends javax.servlet.http.HttpServlet

See Also:
Serialized Form

Nested Class Summary
static class StaticServlet.Error
           
static interface StaticServlet.LookupResult
           
static class StaticServlet.StaticFile
           
 
Field Summary
protected static int bufferSize
           
 
Constructor Summary
StaticServlet()
           
 
Method Summary
protected static boolean acceptsDeflate(javax.servlet.http.HttpServletRequest req)
           
static
<T> T
coalesce(T... ts)
           
protected static boolean deflatable(String mimetype)
           
protected  void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
           
protected  void doHead(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
           
protected  void doPut(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse resp)
           
protected  long getLastModified(javax.servlet.http.HttpServletRequest req)
           
protected  String getMimeType(String path)
           
protected  String getPath(javax.servlet.http.HttpServletRequest req)
           
protected  boolean isForbidden(String path)
           
protected  StaticServlet.LookupResult lookup(javax.servlet.http.HttpServletRequest req)
           
protected  StaticServlet.LookupResult lookupNoCache(javax.servlet.http.HttpServletRequest req)
           
protected static void transferStreams(InputStream is, OutputStream os)
           
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doOptions, doPost, doTrace, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

bufferSize

protected static final int bufferSize
See Also:
Constant Field Values
Constructor Detail

StaticServlet

public StaticServlet()
Method Detail

doGet

protected void doGet(javax.servlet.http.HttpServletRequest req,
                     javax.servlet.http.HttpServletResponse resp)
              throws IOException
Overrides:
doGet in class javax.servlet.http.HttpServlet
Throws:
IOException

doPut

protected void doPut(javax.servlet.http.HttpServletRequest req,
                     javax.servlet.http.HttpServletResponse resp)
              throws IOException
Overrides:
doPut in class javax.servlet.http.HttpServlet
Throws:
IOException

doHead

protected void doHead(javax.servlet.http.HttpServletRequest req,
                      javax.servlet.http.HttpServletResponse resp)
               throws IOException,
                      javax.servlet.ServletException
Overrides:
doHead in class javax.servlet.http.HttpServlet
Throws:
IOException
javax.servlet.ServletException

getLastModified

protected long getLastModified(javax.servlet.http.HttpServletRequest req)
Overrides:
getLastModified in class javax.servlet.http.HttpServlet

lookup

protected StaticServlet.LookupResult lookup(javax.servlet.http.HttpServletRequest req)

lookupNoCache

protected StaticServlet.LookupResult lookupNoCache(javax.servlet.http.HttpServletRequest req)

getPath

protected String getPath(javax.servlet.http.HttpServletRequest req)

isForbidden

protected boolean isForbidden(String path)

coalesce

public static <T> T coalesce(T... ts)

getMimeType

protected String getMimeType(String path)

acceptsDeflate

protected static boolean acceptsDeflate(javax.servlet.http.HttpServletRequest req)

deflatable

protected static boolean deflatable(String mimetype)

transferStreams

protected static void transferStreams(InputStream is,
                                      OutputStream os)
                               throws IOException
Throws:
IOException


Copyright © 2013. All Rights Reserved.