<parent>
<groupId>org.onap.ccsdk.parent</groupId>
<artifactId>odlparent-carbon-sr1</artifactId>
- <version>0.0.1-SNAPSHOT</version>
+ <version>0.0.2-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
public static Map<String, String> convertToProperties(String s) throws JSONException {
JSONObject json = new JSONObject(s);
- Map<String, Object> wm = new HashMap<String, Object>();
+ Map<String, Object> wm = new HashMap<>();
Iterator<String> ii = json.keys();
while (ii.hasNext()) {
String key1 = ii.next();
wm.put(key1, json.get(key1));
}
- Map<String, String> mm = new HashMap<String, String>();
+ Map<String, String> mm = new HashMap<>();
while (!wm.isEmpty())
for (String key : new ArrayList<>(wm.keySet())) {
mm = JsonParser.convertToProperties(r.body);
if (mm != null)
- for (String key : mm.keySet())
- ctx.setAttribute(pp + key, mm.get(key));
+ for (Map.Entry<String,String> entry : mm.entrySet())
+ ctx.setAttribute(pp + entry.getKey(), entry.getValue());
}
}
} catch (Exception e) {
}
protected Set<String> getListNameList(Map<String, String> paramMap) {
- Set<String> ll = new HashSet<String>();
+ Set<String> ll = new HashSet<>();
for (Map.Entry<String,String> entry : paramMap.entrySet())
if (entry.getKey().startsWith("listName"))
ll.add(entry.getValue());
}
protected SSLContext createSSLContext(Parameters p) {
- try {
+ try (FileInputStream in = new FileInputStream(p.keyStoreFileName)) {
System.setProperty("jsse.enableSNIExtension", "false");
System.setProperty("javax.net.ssl.trustStore", p.trustStoreFileName);
System.setProperty("javax.net.ssl.trustStorePassword", p.trustStorePassword);
});
KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
- FileInputStream in = new FileInputStream(p.keyStoreFileName);
KeyStore ks = KeyStore.getInstance("PKCS12");
char[] pwd = p.keyStorePassword.toCharArray();
ks.load(in, pwd);
p.httpMethod = HttpMethod.fromString(parseParam(paramMap, "httpMethod", false, "post"));
p.responsePrefix = parseParam(paramMap, "responsePrefix", false, null);
String skipSendingStr = paramMap.get("skipSending");
- p.skipSending = skipSendingStr != null && skipSendingStr.equalsIgnoreCase("true");
+ p.skipSending = "true".equalsIgnoreCase(skipSendingStr);
return p;
}