diff options
author | emusic <emina.music@egiz.gv.at> | 2018-07-27 12:58:16 +0200 |
---|---|---|
committer | emusic <emina.music@egiz.gv.at> | 2018-07-27 12:58:16 +0200 |
commit | 091b70d41a2a544277612d9f41b0d321f057b0f9 (patch) | |
tree | 14a8c7f8f89e9a06619f6296fb55b096b429fc3f /pdf-as-web/src/main/java/at | |
parent | 3e224770ad6db67f1ca818fd6de52b7e3c3b8863 (diff) | |
download | pdf-as-4-091b70d41a2a544277612d9f41b0d321f057b0f9.tar.gz pdf-as-4-091b70d41a2a544277612d9f41b0d321f057b0f9.tar.bz2 pdf-as-4-091b70d41a2a544277612d9f41b0d321f057b0f9.zip |
adding transfer of pdf file via pdfurl
Diffstat (limited to 'pdf-as-web/src/main/java/at')
-rw-r--r-- | pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java | 2 | ||||
-rw-r--r-- | pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/PDFURLData.java | 25 |
2 files changed, 14 insertions, 13 deletions
diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java index 4b69e5a8..23e16ec3 100644 --- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java +++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/helper/PdfAsHelper.java @@ -1228,7 +1228,7 @@ public class PdfAsHelper { JsonObject createCAdESSigParams = SL20JSONBuilderUtils.createCreateCAdESCommandParameters( pack.getRequestType().getKeyboxIdentifier(), - //statusRequest.getSignatureData(), + null, generateNSPdfURL(request,response), SL20Constants.SL20_COMMAND_PARAM_CREATE_SIG_CADES_CONTENTMODE_DETACHED, pack.getRequestType().getDataObject().getMetaInfo().getMimeType(), diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/PDFURLData.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/PDFURLData.java index 9dfa0d16..d4112cad 100644 --- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/PDFURLData.java +++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/PDFURLData.java @@ -1,14 +1,8 @@ package at.gv.egiz.pdfas.web.servlets; -import at.gv.egiz.pdfas.api.ws.PDFASVerificationResponse; import at.gv.egiz.pdfas.common.exceptions.PDFIOException; import at.gv.egiz.pdfas.common.utils.PDFUtils; import at.gv.egiz.pdfas.lib.api.StatusRequest; -import at.gv.egiz.pdfas.web.config.WebConfiguration; -import at.gv.egiz.pdfas.web.helper.PdfAsHelper; -import at.gv.egiz.pdfas.web.helper.PdfAsParameterExtractor; -import at.gv.egiz.pdfas.web.stats.StatisticEvent; -import at.gv.egiz.pdfas.web.stats.StatisticFrontend; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -54,7 +48,10 @@ public class PDFURLData extends HttpServlet { */ protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - this.process(request, response); + try { + this.process(request, response); + } catch (PDFIOException e) { + response.sendError(500, "internal server error"); } } protected void process(HttpServletRequest request, @@ -64,23 +61,27 @@ public class PDFURLData extends HttpServlet { StatusRequest statusRequest = (StatusRequest) session .getAttribute(PDF_STATUS); + if(statusRequest!=null) + { byte[] nonSignedData = statusRequest.getSignatureData(); if (nonSignedData != null) { byte[] blackoutnonSignedData = PDFUtils.blackOutSignature(nonSignedData, statusRequest.getSignatureDataByteRange()); - response.setContentType("application/pdf"); OutputStream os = response.getOutputStream(); os.write(blackoutnonSignedData); os.close(); + logger.debug("pdf file transfer finished"); } else { - PdfAsHelper.setSessionException(request, response, - "todo", null); - PdfAsHelper.gotoError(getServletContext(), request, response); - response.sendError(500, ''); + logger.info("no pdf document is found"); + response.sendError(500, "no signed data found"); + } + } else { + logger.info("no session found"); + response.sendError(500, "no signed data found"); } } }
\ No newline at end of file |