aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsurya-huawei <a.u.surya@huawei.com>2017-09-28 11:16:21 +0530
committersurya-huawei <a.u.surya@huawei.com>2017-09-28 11:17:56 +0530
commit6dc1f4c1f69f1a02926a0bcc06b812a0c28f3e34 (patch)
tree3bc249fefb3774d7b20b2bfcb610857ff9129b04
parentf70df11736442059b5aa28590cbf4885a3fb82a1 (diff)
Close the inputstream
*Use try with resources to close the resource This is done to ensure that the resource is closed Issue-Id: CCSDK-87 Change-Id: Ie5ebcffcec3350902305b35909e64d3cd518c49b Signed-off-by: surya-huawei <a.u.surya@huawei.com>
-rwxr-xr-xaai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIService.java3
1 files changed, 1 insertions, 2 deletions
diff --git a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIService.java b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIService.java
index 840062e7..d3d57eaa 100755
--- a/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIService.java
+++ b/aai-service/provider/src/main/java/org/onap/ccsdk/sli/adaptors/aai/AAIService.java
@@ -290,12 +290,11 @@ public class AAIService extends AAIDeclarations implements AAIClient, SvcLogicRe
ctx = SSLContext.getInstance("TLS");
KeyManagerFactory kmf = null;
- try {
+ try (FileInputStream fin = new FileInputStream(keystore_path)){
String def = "SunX509";
String storeType = "PKCS12";
def = KeyStore.getDefaultType();
kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
- FileInputStream fin = new FileInputStream(keystore_path);
String extension = keystore_path.substring(keystore_path.lastIndexOf(".") + 1);
if("JKS".equalsIgnoreCase(extension)) {