From d16a7c27a77399806d1e2c6ae082e98d456c3baf Mon Sep 17 00:00:00 2001 From: Andreas Fitzek Date: Tue, 21 Oct 2014 10:28:54 +0200 Subject: PDF API update to ouput signed documents via output stream --- .../src/test/java/at/gv/egiz/param_tests/SignatureTest.java | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'pdf-as-tests/src/test/java/at/gv/egiz') diff --git a/pdf-as-tests/src/test/java/at/gv/egiz/param_tests/SignatureTest.java b/pdf-as-tests/src/test/java/at/gv/egiz/param_tests/SignatureTest.java index 6b18afa5..f0e47896 100644 --- a/pdf-as-tests/src/test/java/at/gv/egiz/param_tests/SignatureTest.java +++ b/pdf-as-tests/src/test/java/at/gv/egiz/param_tests/SignatureTest.java @@ -101,9 +101,9 @@ public class SignatureTest { pdfAs = PdfAsFactory.createPdfAs(new File(baseTestData .getConfigurationFile())); Configuration configuration = pdfAs.getConfiguration(); - + FileOutputStream fos = new FileOutputStream(outputPdfFile, false); signParameter = PdfAsFactory.createSignParameter(configuration, - dataSource); + dataSource, fos); String id = UUID.randomUUID().toString(); signParameter.setTransactionId(id); @@ -157,11 +157,9 @@ public class SignatureTest { signParameter.setSignatureProfileId(baseTestData.getProfilID()); logger.debug("Starting signature for " + baseTestData.getPdfFile()); logger.debug("Selected signature Profile " + baseTestData.getProfilID()); - SignResult result = pdfAs.sign(signParameter); - FileOutputStream fos = null; + @SuppressWarnings("unused") + SignResult result = pdfAs.sign(signParameter); try { - fos = new FileOutputStream(outputPdfFile, false); - IOUtils.copy(result.getOutputDocument(), fos); fos.close(); } catch (IOException e) { logger.debug("IO exception occured while writing PDF output file", -- cgit v1.2.3