*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>
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)) {