org.glite.security.voms.webui
Class FileServlet

java.lang.Object
  extended byjavax.servlet.GenericServlet
      extended byjavax.servlet.http.HttpServlet
          extended byorg.glite.security.voms.webui.FileServlet
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class FileServlet
extends javax.servlet.http.HttpServlet

Serving an HTML file. The source can be

  1. The VO specific configuration directory ($GLITE_LOCATION_VAR/etc/voms-admin/VO/web/...)
  2. The default configuration directory ($GLITE_LOCATION_VAR/etc/voms-admin/web/...)
  3. The war file of the voms-admin service.
This class shall be configured as the default dispatcher for HTML files:
   <servlet>
     <servlet-name>voms-html</servlet-name>
     <servlet-class>org.glite.security.voms.webui.FileServlet</servlet-class>
   </servlet>

   <servlet-mapping>
     <servlet-name>voms-html</servlet-name>
     <url-pattern>*.html</url-pattern>
   </servlet-mapping>
 

See Also:
Serialized Form

Constructor Summary
FileServlet()
           
 
Method Summary
 void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse response)
          Respond to a GET request for the content produced by this servlet.
static java.io.InputStream getFile(java.lang.String name, javax.servlet.ServletContext ctx)
          Returns the file as an inputstream, if possible.
protected  boolean validRequest(javax.servlet.http.HttpServletRequest req)
          Some sanity check on the file names, which are to be returned.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, doPost, doPut, doTrace, getLastModified, 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
 

Constructor Detail

FileServlet

public FileServlet()
Method Detail

doGet

public void doGet(javax.servlet.http.HttpServletRequest req,
                  javax.servlet.http.HttpServletResponse response)
           throws java.io.IOException,
                  javax.servlet.ServletException
Respond to a GET request for the content produced by this servlet.

Parameters:
req - The servlet request we are processing
response - The servlet response we are producing
Throws:
java.io.IOException - if an input/output error occurs
javax.servlet.ServletException - if a servlet error occurs

validRequest

protected boolean validRequest(javax.servlet.http.HttpServletRequest req)
                        throws java.io.IOException,
                               javax.servlet.ServletException
Some sanity check on the file names, which are to be returned.

Throws:
java.io.IOException
javax.servlet.ServletException

getFile

public static java.io.InputStream getFile(java.lang.String name,
                                          javax.servlet.ServletContext ctx)
                                   throws java.io.IOException
Returns the file as an inputstream, if possible.

Throws:
java.io.IOException