diff options
author | (no author) <(no author)@d688527b-c9ab-4aba-bd8d-4036d912da1d> | 2007-08-02 14:35:31 +0000 |
---|---|---|
committer | (no author) <(no author)@d688527b-c9ab-4aba-bd8d-4036d912da1d> | 2007-08-02 14:35:31 +0000 |
commit | 33e7890166717f636014aa2c883083d8fc1b4ee8 (patch) | |
tree | aa2295bd6540a04ea24915958e0260e5c0bd9d65 /spss.slinterface/src/at/gv/egovernment/moa/spss/slinterface/servlets/HashInputDataServlet.java | |
parent | 86c1bd9b1a07d8c875b5304e78a5c75e9edecde7 (diff) | |
download | moa-id-spss-33e7890166717f636014aa2c883083d8fc1b4ee8.tar.gz moa-id-spss-33e7890166717f636014aa2c883083d8fc1b4ee8.tar.bz2 moa-id-spss-33e7890166717f636014aa2c883083d8fc1b4ee8.zip |
This commit was manufactured by cvs2svn to create tagtags/Build-SPSS-1_4_0
'Build-SPSS-1_4_0'.
git-svn-id: https://joinup.ec.europa.eu/svn/moa-idspss/tags/Build-SPSS-1_4_0@898 d688527b-c9ab-4aba-bd8d-4036d912da1d
Diffstat (limited to 'spss.slinterface/src/at/gv/egovernment/moa/spss/slinterface/servlets/HashInputDataServlet.java')
-rw-r--r-- | spss.slinterface/src/at/gv/egovernment/moa/spss/slinterface/servlets/HashInputDataServlet.java | 93 |
1 files changed, 0 insertions, 93 deletions
diff --git a/spss.slinterface/src/at/gv/egovernment/moa/spss/slinterface/servlets/HashInputDataServlet.java b/spss.slinterface/src/at/gv/egovernment/moa/spss/slinterface/servlets/HashInputDataServlet.java deleted file mode 100644 index 1f82540bb..000000000 --- a/spss.slinterface/src/at/gv/egovernment/moa/spss/slinterface/servlets/HashInputDataServlet.java +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Created on 01.12.2003 - * - * (c) Stabsstelle IKT-Strategie des Bundes - */ -package at.gv.egovernment.moa.spss.slinterface.servlets; - -import java.io.FileInputStream; -import java.io.OutputStream; - -import javax.servlet.ServletException; -import javax.servlet.http.HttpServlet; -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; -import javax.servlet.http.HttpSession; - -import org.apache.log4j.Logger; - -import at.gv.egovernment.moa.spss.slinterface.Constants; -import at.gv.egovernment.moa.spss.slinterface.Utils; -import at.gv.egovernment.moa.spss.slinterface.beans.DataInfoBean; - -/** - * @author Gregor Karlinger (mailto:gregor.karlinger@cio.gv.at) - */ -public class HashInputDataServlet extends HttpServlet -{ - private static Logger logger_ = Logger.getLogger(Constants.LH_SERVLETS_); - - /** - * Default constructor. - */ - public HashInputDataServlet() - { - super(); - } - - public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException - { - // Get DataInfoBean object from session - HttpSession session = request.getSession(false); - if (session == null) - { - String message = "No session available."; - logger_.error(message); - throw new ServletException(message); - } - DataInfoBean dataInfo = (DataInfoBean) session.getAttribute("dataInfo"); - - // Get parameter inicating which hash input data file to show - String hidCountStr = request.getParameter("hidCount"); - if (hidCountStr == null) - { - String message = "Parameter \"hidCount\" not available in request."; - logger_.error(message); - throw new ServletException(message); - } - int hidCount = -1; - try - { - hidCount = Integer.parseInt(hidCountStr); - } - catch (NumberFormatException e) - { - String message = "Parameter \"hidCount\" (\"" + hidCount + "\") is not a valid string representation of an integer."; - logger_.error(message, e); - throw new ServletException(message, e); - } - - // Get file name of temporary HID file - dataInfo.setHashInputDataCount(hidCount); - String hidFilename = dataInfo.getHashInputDataFilename(); - - // Set content type - boolean isSLXHTML = dataInfo.getIsSLXHTMLDocument(); - String contenType = (isSLXHTML) ? "text/html;charset=utf-8" : "application/octet-stream"; - response.setContentType(contenType); - - // Write content from temporary HID file to response OS - try - { - FileInputStream hidFIS = new FileInputStream(hidFilename); - OutputStream responseOS = response.getOutputStream(); - Utils.transferStreams(hidFIS, responseOS); - } - catch (Exception e) - { - String message = "Writing hash input data to response stream failed."; - logger_.error(message, e); - throw new ServletException(message, e); - } - } -} |