com.caucho.servlets
Class FileServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by com.caucho.servlets.FileServlet
All Implemented Interfaces:
java.io.Serializable, Servlet, ServletConfig

public class FileServlet
extends GenericServlet

Serves static files. The cache headers are automatically set on these files.

See Also:
Serialized Form

Constructor Summary
FileServlet()
           
 
Method Summary
 void init(ServletConfig conf)
          Initialize the servlet.
 void removeCacheEntry(java.lang.String uri)
          Removes an entry from the cache
 void service(ServletRequest request, ServletResponse response)
          Service a request.
 void setCharacterEncoding(java.lang.String encoding)
          Sets the character encoding.
 void setEnableRange(boolean isEnable)
          Flag to disable the "Range" header.
 void setGenerateSession(boolean isGenerateSession)
          Flag to generate sessions on requests.
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FileServlet

public FileServlet()
Method Detail

setCharacterEncoding

public void setCharacterEncoding(java.lang.String encoding)
Sets the character encoding.


setEnableRange

public void setEnableRange(boolean isEnable)
Flag to disable the "Range" header.


setGenerateSession

public void setGenerateSession(boolean isGenerateSession)
Flag to generate sessions on requests.


removeCacheEntry

public void removeCacheEntry(java.lang.String uri)
Removes an entry from the cache


init

public void init(ServletConfig conf)
          throws ServletException
Description copied from class: GenericServlet
Initialize the servlet. Most servlets should override the zero parameter init() instead.

Specified by:
init in interface Servlet
Overrides:
init in class GenericServlet
Parameters:
conf - the servlet's configuration
Throws:
ServletException

service

public void service(ServletRequest request,
                    ServletResponse response)
             throws ServletException,
                    java.io.IOException
Description copied from interface: Servlet
Service a request. Since the servlet engine is multithreaded, many threads may execute service simultaneously. Normally, req and res will actually be HttpServletRequest and HttpServletResponse classes.

Parameters:
request - request information. Normally servlets will cast this to HttpServletRequest
response - response information. Normally servlets will cast this to HttpServletRequest
Throws:
ServletException
java.io.IOException