diff options
Diffstat (limited to 'pdf-over-signer/src/main/java/at/asit/pdfover')
3 files changed, 11 insertions, 20 deletions
diff --git a/pdf-over-signer/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4BKUSLConnector.java b/pdf-over-signer/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4BKUSLConnector.java index 124bf43d..a78e33c6 100644 --- a/pdf-over-signer/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4BKUSLConnector.java +++ b/pdf-over-signer/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4BKUSLConnector.java @@ -46,8 +46,7 @@ public class PdfAs4BKUSLConnector extends BaseSLConnector { /** * SLF4J Logger instance **/ - private static final Logger log = LoggerFactory - .getLogger(PdfAs4BKUSLConnector.class); + private static final Logger log = LoggerFactory.getLogger(PdfAs4BKUSLConnector.class); private BkuSlConnector connector; @@ -70,13 +69,11 @@ public class PdfAs4BKUSLConnector extends BaseSLConnector { JAXBElement<?> element = null; try { String slRequestString = SLMarschaller.marshalToString(this.of.createInfoboxReadRequest(request)); - //log.trace(slRequestString); PdfAs4SLRequest slRequest = new PdfAs4SLRequest(slRequestString, null); - String slResponse = this.connector.handleSLRequest(slRequest).getSLRespone(); + String slResponse = this.connector.handleSLRequest(slRequest).getSLResponse(); - element = (JAXBElement<?>) SLMarschaller - .unmarshalFromString(slResponse); + element = (JAXBElement<?>) SLMarschaller.unmarshalFromString(slResponse); } catch (JAXBException e) { throw new PDFIOException("error.pdf.io.03", e); } catch (PdfAs4SLRequestException e) { @@ -90,14 +87,10 @@ public class PdfAs4BKUSLConnector extends BaseSLConnector { } if (element.getValue() instanceof InfoboxReadResponseType) { - InfoboxReadResponseType infoboxReadResponseType = (InfoboxReadResponseType) element - .getValue(); - return infoboxReadResponseType; + return (InfoboxReadResponseType) element.getValue(); } else if (element.getValue() instanceof ErrorResponseType) { - ErrorResponseType errorResponseType = (ErrorResponseType) element - .getValue(); - throw new SLPdfAsException(errorResponseType.getErrorCode(), - errorResponseType.getInfo()); + ErrorResponseType errorResponseType = (ErrorResponseType)element.getValue(); + throw new SLPdfAsException(errorResponseType.getErrorCode(), errorResponseType.getInfo()); } throw new PdfAsException("error.pdf.io.03"); } @@ -118,7 +111,7 @@ public class PdfAs4BKUSLConnector extends BaseSLConnector { signatureData = PDFUtils.blackOutSignature(signatureData, pack.getByteRange()); PdfAs4SLRequest slRequest = new PdfAs4SLRequest(slRequestString, signatureData); - String slResponse = this.connector.handleSLRequest(slRequest).getSLRespone(); + String slResponse = this.connector.handleSLRequest(slRequest).getSLResponse(); element = (JAXBElement<?>) SLMarschaller .unmarshalFromString(slResponse); diff --git a/pdf-over-signer/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4Helper.java b/pdf-over-signer/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4Helper.java index e0b8ff46..a41f2378 100644 --- a/pdf-over-signer/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4Helper.java +++ b/pdf-over-signer/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4Helper.java @@ -33,8 +33,7 @@ public class PdfAs4Helper { * SLF4J Logger instance **/ @SuppressWarnings("unused") - private static final Logger log = LoggerFactory - .getLogger(PdfAs4Helper.class); + private static final Logger log = LoggerFactory.getLogger(PdfAs4Helper.class); /** * PDF-AS Object diff --git a/pdf-over-signer/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4SignatureParameter.java b/pdf-over-signer/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4SignatureParameter.java index 032416cd..b54064ab 100644 --- a/pdf-over-signer/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4SignatureParameter.java +++ b/pdf-over-signer/src/main/java/at/asit/pdfover/signer/pdfas/PdfAs4SignatureParameter.java @@ -76,8 +76,7 @@ public class PdfAs4SignatureParameter extends SignatureParameter { /** * SLF4J Logger instance **/ - static final Logger log = LoggerFactory - .getLogger(PdfAs4SignatureParameter.class); + static final Logger log = LoggerFactory.getLogger(PdfAs4SignatureParameter.class); private String profile = Profile.getDefaultProfile(); /* (non-Javadoc) @@ -210,8 +209,8 @@ public class PdfAs4SignatureParameter extends SignatureParameter { return profileId; } - private String getLangProfilePart(String lang) { - return (lang != null && lang.equals("en")) ? PROFILE_ID_LANG_EN : PROFILE_ID_LANG_DE; + private static String getLangProfilePart(String lang) { + return ("en".equals(lang)) ? PROFILE_ID_LANG_EN : PROFILE_ID_LANG_DE; } @Override |