summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/main/java/org/openecomp/appc/adapter/chef/chefclient/Utils.java10
1 files changed, 2 insertions, 8 deletions
diff --git a/appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/main/java/org/openecomp/appc/adapter/chef/chefclient/Utils.java b/appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/main/java/org/openecomp/appc/adapter/chef/chefclient/Utils.java
index fc64af5d4..07c983a43 100644
--- a/appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/main/java/org/openecomp/appc/adapter/chef/chefclient/Utils.java
+++ b/appc-adapters/appc-chef-adapter/appc-chef-adapter-bundle/src/main/java/org/openecomp/appc/adapter/chef/chefclient/Utils.java
@@ -62,15 +62,9 @@ public class Utils {
public static String signWithRSA(String inStr, String pemPath) {
byte[] outStr = null;
- BufferedReader br = null;
- try {
- br = new BufferedReader(new FileReader(pemPath));
- } catch (FileNotFoundException e) {
- e.printStackTrace();
- }
Security.addProvider(new BouncyCastleProvider());
- try {
-
+ try (FileReader fr = new FileReader(pemPath);
+ BufferedReader br = new BufferedReader(fr)) {
PEMParser pemParser = new PEMParser(br);
JcaPEMKeyConverter converter = new JcaPEMKeyConverter();
Object object = pemParser.readObject();