From 79777d04cf64aa06388bb2027f5e1001015471f3 Mon Sep 17 00:00:00 2001 From: pdanner Date: Mon, 6 Dec 2010 18:23:49 +0000 Subject: javadoc an cleanup of unneeded code (mainly already out-commented) git-svn-id: https://joinup.ec.europa.eu/svn/pdf-as/trunk@690 7b5415b0-85f9-ee4d-85bd-d5d0c3b42d1c --- .../gv/egiz/pdfas/web/servlets/DataURLServlet.java | 72 +++++----------------- 1 file changed, 15 insertions(+), 57 deletions(-) (limited to 'pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/DataURLServlet.java') diff --git a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/DataURLServlet.java b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/DataURLServlet.java index 2f6a76c..51a2d6e 100644 --- a/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/DataURLServlet.java +++ b/pdf-as-web/src/main/java/at/gv/egiz/pdfas/web/servlets/DataURLServlet.java @@ -203,17 +203,6 @@ public class DataURLServlet extends HttpServlet si.localBKUParams = bkuParams; pdfAsInternal.verifyBKUSupport(bkuParams); - -// Properties response_properties = BKUHelper.getBKUProperties(request); -// -// String bkuIdentifier = BKUHelper.getBKUIdentifier(response_properties); -// log.debug("BKU identifier: \"" + bkuIdentifier + "\""); -// -// try { -// SignatureLayoutHandlerFactory.verifyBKUSupport(bkuIdentifier); -// } catch (SettingsException e) { -// throw new ConnectorException(e.getErrorCode(), e.getMessage()); -// } if (isNullResponse(xml_response)) { @@ -237,9 +226,6 @@ public class DataURLServlet extends HttpServlet { log.debug("Received a normal response -> storing the response."); //$NON-NLS-1$ -// response_properties.setProperty(BKUPostConnection.RESPONSE_STRING_KEY, xml_response); -// -// si.response_properties = response_properties; si.xmlResponse = xml_response; log.debug("All requests have been processed -> processing the responses."); //$NON-NLS-1$ @@ -248,23 +234,9 @@ public class DataURLServlet extends HttpServlet if (!si.outputAvailable) { - PdfAs pdfAs = ApiHelper.getPdfAsFromContext(getServletContext()); - SignServletHelper.finishLocalSign(pdfAs, pdfAsInternal, si); - SigningTimeHelper.checkSigningTimeAgainstHostTime(si.sdi.getSignDate()); -// LocalConnector c = ConnectorChooser.chooseLocalConnectorForSign(si.connector, si.type, "loc ref content not needed here"); //$NON-NLS-1$ -// -// si.si.setSignSignatureObject(c.analyzeSignResponse(si.response_properties)); -// -// // workaround for invalid signing time -// SigningTimeHelper.checkSigningTimeAgainstHostTime(si.sdi.getSignDate()); -// -// PdfASID algorithm = FormFields.translateSignatureModeToPdfASID(si.mode); -// Signator signator = SignatorFactory.createSignator(algorithm); -// -// si.output = TempDirHelper.createTempDataSink(si.filename + "_signed.pdf"); -// -// signator.finishSign(si.si, si.output); - + PdfAs pdfAs = ApiHelper.getPdfAsFromContext(getServletContext()); + SignServletHelper.finishLocalSign(pdfAs, pdfAsInternal, si); + SigningTimeHelper.checkSigningTimeAgainstHostTime(si.sdi.getSignDate()); si.outputAvailable = true; } @@ -279,7 +251,6 @@ public class DataURLServlet extends HttpServlet response.setContentType("text/plain"); response.setCharacterEncoding("UTF-8"); response.getWriter().println("Das detached XML kann nicht direkt durch die BKU geschliffen werden, weil diese es als Request interpretieren würde. Daher das XML als Text:"); - //response.getWriter().println(si.sdi.getSignSignatureObject().response_properties.getProperty(BKUPostConnection.RESPONSE_STRING_KEY)); response.getWriter().println(new String(si.signedPdf, "UTF-8")); } else @@ -332,9 +303,6 @@ public class DataURLServlet extends HttpServlet { log.debug("Recieved a normal response -> storing the response."); //$NON-NLS-1$ -// Properties response_properties = new Properties(); -// response_properties.setProperty(BKUPostConnection.RESPONSE_STRING_KEY, xml_response); - si.currentLocalOperation.finishCurrentOperation(xml_response); } @@ -360,31 +328,21 @@ public class DataURLServlet extends HttpServlet for (int i = 0; i < si.currentLocalOperation.response_xmls.length; i++) { SignatureInformation sigInfo = (SignatureInformation) si.currentLocalOperation.signaturesToBeverified.get(i); - -// PdfASID sig_kz = sh.getSignatureObject().getKZ(); -// String sig_id = sh.getSignatureObject().getSignationIds(); -// -// LocalConnector c = ConnectorChooser.chooseLocalConnectorForVerify(si.connector, sig_kz, sig_id, si.type, "loc ref content not needed here"); //$NON-NLS-1$ - VerifyResult result = pdfAsInternal.finishLocalVerify(sigInfo, si.connector, si.type, "loc ref content not needed here", si.currentLocalOperation.response_xmls[i]); resList.add(result); -// SignatureResponse sig_resp = c.analyzeVerifyResponse(si.currentLocalOperation.response_xmls[i]); -// results.add(sig_resp); - } + } - si.currentLocalOperation = null; - - URL btlURL = new URL(LocalRequestHelper.getLocalContextAddress(request, response) + "/jsp/verifylist.jsp"); - String backToListURL = response.encodeURL(btlURL.toString()); - - VerifyResults results = new VerifyResults() { - - public List getResults() { - return resList; - } - }; - dispatchToResults(results, request, response, backToListURL); - } + si.currentLocalOperation = null; + + URL btlURL = new URL(LocalRequestHelper.getLocalContextAddress(request, response) + "/jsp/verifylist.jsp"); + String backToListURL = response.encodeURL(btlURL.toString()); + VerifyResults results = new VerifyResults() { + public List getResults() { + return resList; + } + }; + dispatchToResults(results, request, response, backToListURL); + } } } -- cgit v1.2.3