org.sourcejammer.web.servlet
Class ShowFileController

java.lang.Object
  |
  +--javax.servlet.GenericServlet
        |
        +--javax.servlet.http.HttpServlet
              |
              +--org.sourcejammer.web.servlet.ShowFileController
All Implemented Interfaces:
java.io.Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class ShowFileController
extends javax.servlet.http.HttpServlet

Title: $FileName: ShowFileController.java$

Version:
$VerNum: 1$
Author:
$AuthorName: Rob MacGrogan$

$Description: Gives no-session access to latest versions of files in archive. No need to pass through archive selection page. Just set up a like like ShowFile?archive_name=SourceJammer&id=100 and you'll see the file.$
$KeyWordsOff: $
See Also:
Serialized Form

Field Summary
private  javax.servlet.ServletConfig mConfig
           
 
Fields inherited from class javax.servlet.http.HttpServlet
 
Fields inherited from class javax.servlet.GenericServlet
 
Constructor Summary
ShowFileController()
           
 
Method Summary
protected  void displayException(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.Exception ex)
          Forwards to the error page, which displays info about the Exception.
 void doGet(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 void doPost(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
protected  void forward(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.lang.String location)
          Forwards control to the specified page.
private  Archive getArchive(java.lang.String name)
           
 void init(javax.servlet.ServletConfig config)
           
protected  void process(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
protected  void sendFile(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, java.io.File fl, java.lang.String fileName)
          Sends the file as the response to the user's browser.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mConfig

private javax.servlet.ServletConfig mConfig
Constructor Detail

ShowFileController

public ShowFileController()
Method Detail

init

public void init(javax.servlet.ServletConfig config)
          throws javax.servlet.ServletException
Specified by:
init in interface javax.servlet.Servlet
Overrides:
init in class javax.servlet.GenericServlet
javax.servlet.ServletException

doGet

public void doGet(javax.servlet.http.HttpServletRequest request,
                  javax.servlet.http.HttpServletResponse response)
           throws javax.servlet.ServletException,
                  java.io.IOException
Overrides:
doGet in class javax.servlet.http.HttpServlet
javax.servlet.ServletException
java.io.IOException

doPost

public void doPost(javax.servlet.http.HttpServletRequest request,
                   javax.servlet.http.HttpServletResponse response)
            throws javax.servlet.ServletException,
                   java.io.IOException
Overrides:
doPost in class javax.servlet.http.HttpServlet
javax.servlet.ServletException
java.io.IOException

getArchive

private Archive getArchive(java.lang.String name)
                    throws FileAccessException
FileAccessException

process

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

sendFile

protected void sendFile(javax.servlet.http.HttpServletRequest request,
                        javax.servlet.http.HttpServletResponse response,
                        java.io.File fl,
                        java.lang.String fileName)
                 throws java.io.IOException
Sends the file as the response to the user's browser.

java.io.IOException

displayException

protected void displayException(javax.servlet.http.HttpServletRequest request,
                                javax.servlet.http.HttpServletResponse response,
                                java.lang.Exception ex)
                         throws javax.servlet.ServletException,
                                java.io.IOException
Forwards to the error page, which displays info about the Exception.

javax.servlet.ServletException
java.io.IOException

forward

protected void forward(javax.servlet.http.HttpServletRequest request,
                       javax.servlet.http.HttpServletResponse response,
                       java.lang.String location)
                throws javax.servlet.ServletException,
                       java.io.IOException
Forwards control to the specified page.

javax.servlet.ServletException
java.io.IOException


Copyright 2003 Soucejammer project.