diff options
author | Nelson,Thomas(tn1381)(arthurdent3) <tn1381@att.com> | 2019-01-29 15:55:37 -0500 |
---|---|---|
committer | Nelson,Thomas(tn1381)(arthurdent3) <tn1381@att.com> | 2019-01-29 16:05:01 -0500 |
commit | a27be9fdbbf2d271c9c5780ba70fe15a24dbdb63 (patch) | |
tree | 1fa631eae149ed6be33b636e7eac03dadbef64c3 /jar/src/main/java/org/onap/music/main/MusicUtil.java | |
parent | 95489883ce973e84267fcbcee685f1598d4bdd6e (diff) |
Push variuos changes
- Spring Boot
- Cadi
- Cassandra Locking
Change-Id: Ie9882f81f0ca141bdb7862cdabf978481fcd7c4a
Issue-ID: MUSIC-296,MUSIC-272
Signed-off-by: Nelson,Thomas(tn1381)(arthurdent3) <tn1381@att.com>
Diffstat (limited to 'jar/src/main/java/org/onap/music/main/MusicUtil.java')
-rwxr-xr-x | jar/src/main/java/org/onap/music/main/MusicUtil.java | 71 |
1 files changed, 36 insertions, 35 deletions
diff --git a/jar/src/main/java/org/onap/music/main/MusicUtil.java b/jar/src/main/java/org/onap/music/main/MusicUtil.java index 77afb57e..0e844215 100755 --- a/jar/src/main/java/org/onap/music/main/MusicUtil.java +++ b/jar/src/main/java/org/onap/music/main/MusicUtil.java @@ -19,6 +19,7 @@ * ============LICENSE_END============================================= * ==================================================================== */ + package org.onap.music.main; import java.io.File; @@ -531,42 +532,42 @@ public class MusicUtil { public static void loadProperties() throws Exception { - CipherUtil.readAndSetKeyString(); + CipherUtil.readAndSetKeyString(); Properties prop = new Properties(); - InputStream input = null; - try { - // load the properties file - input = MusicUtil.class.getClassLoader().getResourceAsStream("music.properties"); - prop.load(input); - } catch (Exception ex) { - logger.error(EELFLoggerDelegate.errorLogger, "Unable to find properties file."); - throw new Exception(); - } finally { - if (input != null) { - try { - input.close(); - } catch (IOException e) { - e.printStackTrace(); - } - } - } - String cassPwd = prop.getProperty("cassandra.password"); - String isEncrypted = prop.getProperty("cassandra.password.isencrypted"); - logger.info(EELFLoggerDelegate.applicationLogger,"cassandra.password:" + cassPwd); - logger.info(EELFLoggerDelegate.applicationLogger,"cassandra.password.isencrypted:" + isEncrypted); - if("true".equals(isEncrypted)) { - logger.info(EELFLoggerDelegate.applicationLogger,"Decrypting...."); - cassPwd = CipherUtil.decryptPKC(cassPwd); - logger.info(EELFLoggerDelegate.applicationLogger,"Decrypted password: "+cassPwd); - MusicUtil.setCassPwd(cassPwd); - } else - MusicUtil.setCassPwd(cassPwd); - // get the property value and return it - MusicUtil.setMyCassaHost(prop.getProperty("cassandra.host")); - String zkHosts = prop.getProperty("zookeeper.host"); - MusicUtil.setMyZkHost(zkHosts); - MusicUtil.setCassName(prop.getProperty("cassandra.user")); - } + InputStream input = null; + try { + // load the properties file + input = MusicUtil.class.getClassLoader().getResourceAsStream("music.properties"); + prop.load(input); + } catch (Exception ex) { + logger.error(EELFLoggerDelegate.errorLogger, "Unable to find properties file."); + throw new Exception(); + } finally { + if (input != null) { + try { + input.close(); + } catch (IOException e) { + e.printStackTrace(); + } + } + } + String cassPwd = prop.getProperty("cassandra.password"); + String isEncrypted = prop.getProperty("cassandra.password.isencrypted"); + logger.info(EELFLoggerDelegate.applicationLogger,"cassandra.password:" + cassPwd); + logger.info(EELFLoggerDelegate.applicationLogger,"cassandra.password.isencrypted:" + isEncrypted); + if("true".equals(isEncrypted)) { + logger.info(EELFLoggerDelegate.applicationLogger,"Decrypting...."); + cassPwd = CipherUtil.decryptPKC(cassPwd); + logger.info(EELFLoggerDelegate.applicationLogger,"Decrypted password: "+cassPwd); + MusicUtil.setCassPwd(cassPwd); + } else + MusicUtil.setCassPwd(cassPwd); + // get the property value and return it + MusicUtil.setMyCassaHost(prop.getProperty("cassandra.host")); + String zkHosts = prop.getProperty("zookeeper.host"); + MusicUtil.setMyZkHost(zkHosts); + MusicUtil.setCassName(prop.getProperty("cassandra.user")); + } } |