diff options
author | Christof Rabensteiner <christof.rabensteiner@iaik.tugraz.at> | 2019-06-13 10:35:44 +0200 |
---|---|---|
committer | Christof Rabensteiner <christof.rabensteiner@iaik.tugraz.at> | 2019-06-13 10:35:44 +0200 |
commit | 2a765b9c3a0d20bf2794c569f584bde05fb21d16 (patch) | |
tree | d1136f9835f60f31059d59cc83b21353628b9a20 /src/main | |
parent | d440b9ddd4fd0132977f39d9e91ca6144b64fdb3 (diff) | |
download | moa-zs-2a765b9c3a0d20bf2794c569f584bde05fb21d16.tar.gz moa-zs-2a765b9c3a0d20bf2794c569f584bde05fb21d16.tar.bz2 moa-zs-2a765b9c3a0d20bf2794c569f584bde05fb21d16.zip |
Refactor: Create and Reuse Info Message Template
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/at/gv/egiz/moazs/config/MoaSigConfig.java | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/main/java/at/gv/egiz/moazs/config/MoaSigConfig.java b/src/main/java/at/gv/egiz/moazs/config/MoaSigConfig.java index c611f9e..84e5299 100644 --- a/src/main/java/at/gv/egiz/moazs/config/MoaSigConfig.java +++ b/src/main/java/at/gv/egiz/moazs/config/MoaSigConfig.java @@ -22,6 +22,7 @@ public class MoaSigConfig { private static final String MOA_SPSS_CONFIG_FILE_PROPERTY = "moa.spss.server.configuration"; private static final String JAVAX_SSL_TRUSTSTORE_TYPE_PROPERTY = "javax.net.ssl.trustStoreType"; private static final String JAVAX_SSL_KEYSTORE_TYPE_PROPERTY = "javax.net.ssl.keyStoreType"; + private static final String SET_PROPERTY_MSG_TEMPLATE = "Set system property '{}' to {}" ; private final String trustStoreType; private final String keyStoreType; @@ -48,7 +49,7 @@ public class MoaSigConfig { var realFile = new File(realPath); if(realFile.exists() && realFile.canRead()) { - log.info("Set system property '{}' to {}", MOA_SPSS_CONFIG_FILE_PROPERTY, realPath); + log.info(SET_PROPERTY_MSG_TEMPLATE, MOA_SPSS_CONFIG_FILE_PROPERTY, realPath); System.getProperties().setProperty(MOA_SPSS_CONFIG_FILE_PROPERTY, realPath); } else { throw new FileNotFoundException("File '" + realPath + "' does not exist or is not readable."); @@ -68,12 +69,12 @@ public class MoaSigConfig { private void fallBackToSpringEnvForJavaxNetSSLStoreTypeProperty() { if (System.getProperty(JAVAX_SSL_TRUSTSTORE_TYPE_PROPERTY) == null) { - log.info("Set system property '{}' to {}", JAVAX_SSL_TRUSTSTORE_TYPE_PROPERTY, trustStoreType); + log.info(SET_PROPERTY_MSG_TEMPLATE, JAVAX_SSL_TRUSTSTORE_TYPE_PROPERTY, trustStoreType); System.getProperties().setProperty(JAVAX_SSL_TRUSTSTORE_TYPE_PROPERTY, trustStoreType); } if (System.getProperty(JAVAX_SSL_KEYSTORE_TYPE_PROPERTY) == null) { - log.info("Set system property '{}' to {}", JAVAX_SSL_KEYSTORE_TYPE_PROPERTY, keyStoreType); + log.info(SET_PROPERTY_MSG_TEMPLATE, JAVAX_SSL_KEYSTORE_TYPE_PROPERTY, keyStoreType); System.getProperties().setProperty(JAVAX_SSL_KEYSTORE_TYPE_PROPERTY, keyStoreType); } } @@ -95,7 +96,7 @@ public class MoaSigConfig { return new MoaSPSSSignatureVerifier(moaSigVerifyService(), defaultTrustProfile); } else { log.warn("Moa SPSS is not active. Signatures in SOAP Messages will not be verified."); - return (signedXMLdocument) -> true; + return signedXMLdocument -> true; } } } |