com.jurismarches.vradi.services
Class FileServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by com.jurismarches.vradi.services.FileServlet
All Implemented Interfaces:
Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig

public class FileServlet
extends javax.servlet.http.HttpServlet

Vradi file service (upload/download).

Version:
$Revision: 1807 $ Last update : $Date: 2010-11-24 16:11:33 +0100 (mer., 24 nov. 2010) $ By : $Author: sletellier $
Author:
chatellier
See Also:
Serialized Form

Field Summary
protected  FileService fileService
          File service instance.
 
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  String[] getParametersFormRequestURI(javax.servlet.http.HttpServletRequest request)
          Get parameters from URI.
protected  void goGetFile(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, File file, VradiConstants.FileType fileType)
          Stream file to response output to download.
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doHead, doOptions, 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

fileService

protected FileService fileService
File service instance.

Constructor Detail

FileServlet

public FileServlet()
Method Detail

getParametersFormRequestURI

protected String[] getParametersFormRequestURI(javax.servlet.http.HttpServletRequest request)
Get parameters from URI. If servlet is called with url : /vradi/file/TEMPLATE/AO and mapped on /file/* in web.xml Parameters will be { "TEMPLATE", "AO" } Another example is : Called url : /vradi/file/PDF/xyz/toto.pdf Parameters will be { "PDF", "xyz/toto.pdf" }

Parameters:
request -
Returns:

doGet

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

goGetFile

protected void goGetFile(javax.servlet.http.HttpServletRequest request,
                         javax.servlet.http.HttpServletResponse response,
                         File file,
                         VradiConstants.FileType fileType)
                  throws IOException
Stream file to response output to download.

Parameters:
request - request
response - response
file - file to download
Throws:
IOException

doPost

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


Copyright © 2009-2010 JurisMarches. All Rights Reserved.