SK.gnome.dwarf.http.servlet
Class FileServlet

java.lang.Object
  extended byjavax.servlet.GenericServlet
      extended byjavax.servlet.http.HttpServlet
          extended bySK.gnome.dwarf.http.servlet.FileServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig
Direct Known Subclasses:
WebDAVServlet

public class FileServlet
extends javax.servlet.http.HttpServlet

This servlet serves files from the filesystem.

It accepts initial parameter named "defaultPages", which must be a comma-separated list of file names, for example "index.jsp,index.html". A default page is a page which is served if no particular file from the directory has been requested by the end user.

This servlet supports also directory indexes if the "dirIndex" initial parameter is set to true. Directory index is a HTML page with a list of subdirectories and files within the given directory. It is displayed only if no default page can be found for the given directory. If the "/icons/file.gif" file exists within the web application's root directory, the servlet will generate the index pages with the images found in the "/icons/" directory. Currently, only these image file names are recognized:

This servlet overrides the superclass' getLastModified method to check for the last modification time of the requested files.

See Also:
Serialized Form

Constructor Summary
FileServlet()
           
 
Method Summary
protected  void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
protected  void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
protected  long getLastModified(javax.servlet.http.HttpServletRequest request)
           
 java.lang.String getServletInfo()
           
 void init()
           
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doOptions, doPut, doTrace, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FileServlet

public FileServlet()
Method Detail

init

public void init()
          throws javax.servlet.ServletException
Throws:
javax.servlet.ServletException

getServletInfo

public java.lang.String getServletInfo()

doGet

protected void doGet(javax.servlet.http.HttpServletRequest request,
                     javax.servlet.http.HttpServletResponse response)
              throws java.io.IOException,
                     javax.servlet.ServletException
Throws:
java.io.IOException
javax.servlet.ServletException

doPost

protected void doPost(javax.servlet.http.HttpServletRequest request,
                      javax.servlet.http.HttpServletResponse response)
               throws java.io.IOException,
                      javax.servlet.ServletException
Throws:
java.io.IOException
javax.servlet.ServletException

getLastModified

protected long getLastModified(javax.servlet.http.HttpServletRequest request)


Copyright (c) 1999-2005, Gnome Ltd. All rights reserved.