Skip to content

Commit

Permalink
Add SSL
Browse files Browse the repository at this point in the history
  • Loading branch information
GedMarc committed Nov 2, 2024
1 parent 19a2528 commit 7e474f5
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 9 deletions.
2 changes: 2 additions & 0 deletions Vert.x/vertx-core/src/moditect/module-info.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
requires java.logging;
requires jdk.unsupported;

requires static java.naming;

requires transitive com.fasterxml.jackson.databind;
requires transitive com.fasterxml.jackson.core;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,19 +1,60 @@
package com.guicedee.client;

public class Environment
{
public static String getProperty(String key, String defaultValue)
{
if (System.getProperty(key) == null)
{
if (System.getenv(key) == null)
{
import lombok.extern.java.Log;

import java.util.logging.Level;

@Log
public class Environment {
public static String getProperty(String key, String defaultValue) {
if (System.getProperty(key) == null) {
if (System.getenv(key) == null) {
System.setProperty(key, defaultValue);
}else {
} else {
System.setProperty(key, System.getenv(key));
}
}
return System.getProperty(key);
}

/**
* Returns an environment or system defined property with a default value
*
* System Defined Properties (-Dxxx=xxx) override environment variables
*
* @param name The name of the variable
* @param defaultValue The default value to always return
* @return The required value from the environment
*/
public static String getSystemPropertyOrEnvironment(String name, String defaultValue) {
if (System.getProperty(name) != null) {
return System.getProperty(name);
}
if (System.getenv(name) != null) {
try {
System.setProperty(name, System.getenv(name));
return System.getProperty(name);
} catch (Exception T) {
log.log(Level.CONFIG,
"Couldn't set system property value from environment [" + name + "] - [" + defaultValue + "]",
T);
return System.getenv(name);
}
} else {
if (defaultValue == null) {
return "";
}
log.log(Level.CONFIG, "Return default value for default property [" + name + "] - [" + defaultValue + "]");
try {
System.setProperty(name, defaultValue);
return System.getProperty(name);
} catch (Exception T) {
log.log(Level.CONFIG,
"Couldn't set system property value to the default specified [" + name + "] - [" + defaultValue + "]",
T);
return defaultValue;
}
}
}

}

0 comments on commit 7e474f5

Please sign in to comment.