org.edg.security.voms.webui
Class FileServlet

java.lang.Object
  |
  +--javax.servlet.GenericServlet
        |
        +--javax.servlet.http.HttpServlet
              |
              +--org.edg.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 (/var/etc/edg-voms-admin/VO/web/...)
  2. The default configuration directory (/etc/edg-voms-admin/web/...)
  3. The war file of the edg-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.edg.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

Field Summary
private static org.apache.log4j.Logger log
           
 
Fields inherited from class javax.servlet.http.HttpServlet
 
Fields inherited from class javax.servlet.GenericServlet
 
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
 

Field Detail

log

private static org.apache.log4j.Logger log
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.

Overrides:
doGet in class javax.servlet.http.HttpServlet
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.

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.

java.io.IOException