Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions common/src/main/java/com/genexus/GXRuntime.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package com.genexus;

import com.genexus.util.*;
import java.util.Map;

public class GXRuntime {
static public short getEnvironment() {
return 1; // RuntimeEnvironment.Server
Expand All @@ -17,4 +20,30 @@ static public void setExitCode(int value) {
static public int getExitCode() {
return exitCode;
}

public static String GetEnvironmentVariable(String key) {
String value = "";
if (key != null && key.length() > 0){
value = System.getenv(key);
}
return value;
}
public static GXProperties GetEnvironmentVariables() {

Map<String, String> env = System.getenv();
GXProperties gxProperties = new GXProperties();
for (String envName : env.keySet()) {
gxProperties.add(envName,env.get(envName) );
}
return gxProperties;
}

public static boolean HasEnvironmentVariable(String key) {
if (key != null && key.length() > 0){
String value = System.getenv(key);
if (value != null && value.length() > 0)
return true;
}
return false;
}
}