com.jurismarches.vradi.services
Class FileServlet
java.lang.Object
javax.servlet.GenericServlet
javax.servlet.http.HttpServlet
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: 1870 $
Last update : $Date: 2010-12-27 13:35:52 +0100 (lun., 27 déc. 2010) $
By : $Author: sletellier $
- Author:
- chatellier
- See Also:
- Serialized Form
|
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 |
fileService
protected FileService fileService
- File service instance.
FileServlet
public FileServlet()
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 - requestresponse - responsefile - 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-2011 JurisMarches. All Rights Reserved.