cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ko...@apache.org
Subject [3/6] git commit: updated refs/heads/master to c72f65d
Date Sat, 26 Oct 2013 16:30:04 GMT
InputStream use fix

Closes the FileInputStream opened at configuration in
- ClusterManagerImpl
- ClusterServiceServletAdapter
- TransactionLegacy
- AsyncJobManagerImpl
- DBEncryptionUtil
- EncryptionSecretKeyChecker

Signed-off-by: Laszlo Hornyak <laszlo.hornyak@gmail.com>


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/dbaa818d
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/dbaa818d
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/dbaa818d

Branch: refs/heads/master
Commit: dbaa818d1eaf80f7d62792abe380a8c7c2ffa0ac
Parents: c178315
Author: Laszlo Hornyak <laszlo.hornyak@gmail.com>
Authored: Fri Oct 25 20:38:36 2013 +0200
Committer: Laszlo Hornyak <laszlo.hornyak@gmail.com>
Committed: Sat Oct 26 17:47:34 2013 +0200

----------------------------------------------------------------------
 framework/cluster/src/com/cloud/cluster/ClusterManagerImpl.java   | 3 +--
 .../src/com/cloud/cluster/ClusterServiceServletAdapter.java       | 3 +--
 framework/db/src/com/cloud/utils/db/TransactionLegacy.java        | 1 +
 .../cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java       | 3 +--
 utils/src/com/cloud/utils/crypt/DBEncryptionUtil.java             | 2 +-
 utils/src/com/cloud/utils/crypt/EncryptionSecretKeyChecker.java   | 3 +--
 6 files changed, 6 insertions(+), 9 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dbaa818d/framework/cluster/src/com/cloud/cluster/ClusterManagerImpl.java
----------------------------------------------------------------------
diff --git a/framework/cluster/src/com/cloud/cluster/ClusterManagerImpl.java b/framework/cluster/src/com/cloud/cluster/ClusterManagerImpl.java
index 35968ee..71bea4f 100644
--- a/framework/cluster/src/com/cloud/cluster/ClusterManagerImpl.java
+++ b/framework/cluster/src/com/cloud/cluster/ClusterManagerImpl.java
@@ -17,7 +17,6 @@
 package com.cloud.cluster;
 
 import java.io.File;
-import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.net.ConnectException;
@@ -1033,7 +1032,7 @@ public class ClusterManagerImpl extends ManagerBase implements ClusterManager,
C
         File dbPropsFile = PropertiesUtil.findConfigFile("db.properties");
         Properties dbProps = new Properties();
         try {
-            dbProps.load(new FileInputStream(dbPropsFile));
+            PropertiesUtil.loadFromFile(dbProps, dbPropsFile);
         } catch (FileNotFoundException e) {
             throw new ConfigurationException("Unable to find db.properties");
         } catch (IOException e) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dbaa818d/framework/cluster/src/com/cloud/cluster/ClusterServiceServletAdapter.java
----------------------------------------------------------------------
diff --git a/framework/cluster/src/com/cloud/cluster/ClusterServiceServletAdapter.java b/framework/cluster/src/com/cloud/cluster/ClusterServiceServletAdapter.java
index 67df946..f80e21f 100644
--- a/framework/cluster/src/com/cloud/cluster/ClusterServiceServletAdapter.java
+++ b/framework/cluster/src/com/cloud/cluster/ClusterServiceServletAdapter.java
@@ -17,7 +17,6 @@
 package com.cloud.cluster;
 
 import java.io.File;
-import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.IOException;
 import java.rmi.RemoteException;
@@ -126,7 +125,7 @@ public class ClusterServiceServletAdapter extends AdapterBase implements
Cluster
         File dbPropsFile = PropertiesUtil.findConfigFile("db.properties");
         Properties dbProps = new Properties();
         try {
-            dbProps.load(new FileInputStream(dbPropsFile));
+            PropertiesUtil.loadFromFile(dbProps, dbPropsFile);
         } catch (FileNotFoundException e) {
             throw new ConfigurationException("Unable to find db.properties");
         } catch (IOException e) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dbaa818d/framework/db/src/com/cloud/utils/db/TransactionLegacy.java
----------------------------------------------------------------------
diff --git a/framework/db/src/com/cloud/utils/db/TransactionLegacy.java b/framework/db/src/com/cloud/utils/db/TransactionLegacy.java
index 9cf7c3f..a318d83 100755
--- a/framework/db/src/com/cloud/utils/db/TransactionLegacy.java
+++ b/framework/db/src/com/cloud/utils/db/TransactionLegacy.java
@@ -1039,6 +1039,7 @@ public class TransactionLegacy {
                 dbProps = new Properties();
             }
             try {
+                PropertiesUtil.loadFromFile(dbProps, dbPropsFile);
                 dbProps.load(new FileInputStream(dbPropsFile));
             } catch (IOException e) {
                 s_logger.fatal("Unable to load db properties file, pl. check the classpath
and file path configuration", e);

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dbaa818d/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java
----------------------------------------------------------------------
diff --git a/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java
b/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java
index ffc7b3a..29a299f 100644
--- a/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java
+++ b/framework/jobs/src/org/apache/cloudstack/framework/jobs/impl/AsyncJobManagerImpl.java
@@ -18,7 +18,6 @@
 package org.apache.cloudstack.framework.jobs.impl;
 
 import java.io.File;
-import java.io.FileInputStream;
 import java.util.Arrays;
 import java.util.Collections;
 import java.util.Date;
@@ -868,7 +867,7 @@ public class AsyncJobManagerImpl extends ManagerBase implements AsyncJobManager,
         try {
             final File dbPropsFile = PropertiesUtil.findConfigFile("db.properties");
             final Properties dbProps = new Properties();
-            dbProps.load(new FileInputStream(dbPropsFile));
+            PropertiesUtil.loadFromFile(dbProps, dbPropsFile);
 
             final int cloudMaxActive = Integer.parseInt(dbProps.getProperty("db.cloud.maxActive"));
 

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dbaa818d/utils/src/com/cloud/utils/crypt/DBEncryptionUtil.java
----------------------------------------------------------------------
diff --git a/utils/src/com/cloud/utils/crypt/DBEncryptionUtil.java b/utils/src/com/cloud/utils/crypt/DBEncryptionUtil.java
index 06df799..2f44c5a 100755
--- a/utils/src/com/cloud/utils/crypt/DBEncryptionUtil.java
+++ b/utils/src/com/cloud/utils/crypt/DBEncryptionUtil.java
@@ -78,7 +78,7 @@ public class DBEncryptionUtil {
         	StandardPBEStringEncryptor encryptor = EncryptionSecretKeyChecker.getEncryptor();
         	dbProps = new EncryptableProperties(encryptor);
         	try {
-				dbProps.load(new FileInputStream(dbPropsFile));
+        	    PropertiesUtil.loadFromFile(dbProps, dbPropsFile);
 			} catch (FileNotFoundException e) {
 				throw new CloudRuntimeException("db.properties file not found while reading DB secret
key", e);
 			} catch (IOException e) {

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/dbaa818d/utils/src/com/cloud/utils/crypt/EncryptionSecretKeyChecker.java
----------------------------------------------------------------------
diff --git a/utils/src/com/cloud/utils/crypt/EncryptionSecretKeyChecker.java b/utils/src/com/cloud/utils/crypt/EncryptionSecretKeyChecker.java
index bf6c351..56195de 100755
--- a/utils/src/com/cloud/utils/crypt/EncryptionSecretKeyChecker.java
+++ b/utils/src/com/cloud/utils/crypt/EncryptionSecretKeyChecker.java
@@ -18,7 +18,6 @@ package com.cloud.utils.crypt;
 
 import java.io.BufferedReader;
 import java.io.File;
-import java.io.FileInputStream;
 import java.io.FileNotFoundException;
 import java.io.FileReader;
 import java.io.IOException;
@@ -62,7 +61,7 @@ public class EncryptionSecretKeyChecker extends AdapterBase implements SystemInt
         final File dbPropsFile = PropertiesUtil.findConfigFile("db.properties");
         final Properties dbProps = new Properties();
         try {
-            dbProps.load(new FileInputStream(dbPropsFile));
+            PropertiesUtil.loadFromFile(dbProps, dbPropsFile);
 
             final String encryptionType = dbProps.getProperty("db.cloud.encryption.type");
 


Mime
View raw message