You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@guacamole.apache.org by vn...@apache.org on 2018/01/16 17:37:02 UTC

[3/5] guacamole-client git commit: GUACAMOLE-464: use enable-environment-properties as the property name

GUACAMOLE-464: use enable-environment-properties as the property name


Project: http://git-wip-us.apache.org/repos/asf/guacamole-client/repo
Commit: http://git-wip-us.apache.org/repos/asf/guacamole-client/commit/718663d2
Tree: http://git-wip-us.apache.org/repos/asf/guacamole-client/tree/718663d2
Diff: http://git-wip-us.apache.org/repos/asf/guacamole-client/diff/718663d2

Branch: refs/heads/master
Commit: 718663d2c585630914b41625095819737faa7913
Parents: cc99584
Author: Carl Harris <ce...@vt.edu>
Authored: Tue Jan 16 11:49:15 2018 -0500
Committer: Carl Harris <ce...@vt.edu>
Committed: Tue Jan 16 11:49:15 2018 -0500

----------------------------------------------------------------------
 .../guacamole/environment/LocalEnvironment.java | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/guacamole-client/blob/718663d2/guacamole-ext/src/main/java/org/apache/guacamole/environment/LocalEnvironment.java
----------------------------------------------------------------------
diff --git a/guacamole-ext/src/main/java/org/apache/guacamole/environment/LocalEnvironment.java b/guacamole-ext/src/main/java/org/apache/guacamole/environment/LocalEnvironment.java
index 61ec6ad..8faee7a 100644
--- a/guacamole-ext/src/main/java/org/apache/guacamole/environment/LocalEnvironment.java
+++ b/guacamole-ext/src/main/java/org/apache/guacamole/environment/LocalEnvironment.java
@@ -78,11 +78,11 @@ public class LocalEnvironment implements Environment {
      * A property that determines whether environment variables are evaluated
      * to override properties specified in guacamole.properties.
      */
-    private static final BooleanGuacamoleProperty ENVIRONMENT_PROPERTY_OVERRIDE =
+    private static final BooleanGuacamoleProperty ENABLE_ENVIRONMENT_PROPERTIES =
         new BooleanGuacamoleProperty() {
             @Override
             public String getName() {
-                return "enable-environment-overrides";
+                return "enable-environment-properties";
             }
         };
 
@@ -104,7 +104,7 @@ public class LocalEnvironment implements Environment {
     /**
      * Flag indicating whether environment variables can override properties.
      */
-    private final boolean environmentPropertyOverride;
+    private final boolean environmentPropertiesEnabled;
 
     /**
      * The Jackson parser for parsing JSON files.
@@ -161,7 +161,7 @@ public class LocalEnvironment implements Environment {
         availableProtocols = readProtocols();
 
         // Should environment variables override configuration properties?
-        environmentPropertyOverride = propertyOverrideEnabled(properties);
+        environmentPropertiesEnabled = environmentPropertiesEnabled(properties);
     }
 
     /**
@@ -321,7 +321,7 @@ public class LocalEnvironment implements Environment {
     }
 
     /**
-     * Checks for the presence of the {@link #ENVIRONMENT_PROPERTY_OVERRIDE}
+     * Checks for the presence of the {@link #ENABLE_ENVIRONMENT_PROPERTIES}
      * property in the given properties collection.
      *
      * @param properties
@@ -335,13 +335,13 @@ public class LocalEnvironment implements Environment {
      *                            cannot be successfully parsed as a Boolean
      *
      */
-    private static boolean propertyOverrideEnabled(Properties properties)
+    private static boolean environmentPropertiesEnabled(Properties properties)
             throws GuacamoleException {
 
-        final Boolean enableOverrides = ENVIRONMENT_PROPERTY_OVERRIDE.parseValue(
-                properties.getProperty(ENVIRONMENT_PROPERTY_OVERRIDE.getName()));
+        final Boolean enabled = ENABLE_ENVIRONMENT_PROPERTIES.parseValue(
+                properties.getProperty(ENABLE_ENVIRONMENT_PROPERTIES.getName()));
 
-        return enableOverrides != null && enableOverrides;
+        return enabled != null && enabled;
     }
 
     @Override
@@ -371,7 +371,7 @@ public class LocalEnvironment implements Environment {
     private String getPropertyValue(String name) {
 
         // Check for corresponding environment variable if overrides enabled
-        if (environmentPropertyOverride) {
+        if (environmentPropertiesEnabled) {
 
             // Transform the name according to common convention
             final String envName = name.replace('-', '_').toUpperCase();