aboutsummaryrefslogtreecommitdiffstats
path: root/rest-services/dmaap-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/dmaap/client/utlis/SecurityKeysUtil.java
diff options
context:
space:
mode:
Diffstat (limited to 'rest-services/dmaap-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/dmaap/client/utlis/SecurityKeysUtil.java')
-rw-r--r--rest-services/dmaap-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/dmaap/client/utlis/SecurityKeysUtil.java19
1 files changed, 7 insertions, 12 deletions
diff --git a/rest-services/dmaap-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/dmaap/client/utlis/SecurityKeysUtil.java b/rest-services/dmaap-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/dmaap/client/utlis/SecurityKeysUtil.java
index 7ee06e9c..d487e19b 100644
--- a/rest-services/dmaap-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/dmaap/client/utlis/SecurityKeysUtil.java
+++ b/rest-services/dmaap-client/src/main/java/org/onap/dcaegen2/services/sdk/rest/services/dmaap/client/utlis/SecurityKeysUtil.java
@@ -20,8 +20,6 @@
package org.onap.dcaegen2.services.sdk.rest.services.dmaap.client.utlis;
-import io.vavr.control.Try;
-import java.nio.file.Path;
import java.nio.file.Paths;
import org.jetbrains.annotations.NotNull;
import org.onap.dcaegen2.services.sdk.rest.services.dmaap.client.config.DmaapCustomConfig;
@@ -32,20 +30,17 @@ import org.onap.dcaegen2.services.sdk.security.ssl.SecurityKeys;
public final class SecurityKeysUtil {
- private SecurityKeysUtil(){
+ private SecurityKeysUtil() {
}
@NotNull
- public static SecurityKeys fromDmappCustomConfig(DmaapCustomConfig configuration){
+ public static SecurityKeys fromDmappCustomConfig(DmaapCustomConfig configuration) {
return ImmutableSecurityKeys.builder()
- .keyStore(ImmutableSecurityKeysStore.of(resource(configuration.keyStorePath()).get()))
- .keyStorePassword(Passwords.fromResource(configuration.keyStorePasswordPath()))
- .trustStore(ImmutableSecurityKeysStore.of(resource(configuration.trustStorePath()).get()))
- .trustStorePassword(Passwords.fromResource(configuration.trustStorePasswordPath()))
+ .keyStore(ImmutableSecurityKeysStore.of(Paths.get(configuration.keyStorePath())))
+ .keyStorePassword(Passwords.fromPath(Paths.get(configuration.keyStorePasswordPath())))
+ .trustStore(ImmutableSecurityKeysStore.of(Paths.get(configuration.trustStorePath())))
+ .trustStorePassword(Passwords.fromPath(Paths.get(configuration.trustStorePasswordPath())))
.build();
}
-
- private static Try<Path> resource(String resource) {
- return Try.of(() -> Paths.get(Passwords.class.getResource(resource).toURI()));
- }}
+} \ No newline at end of file