![JAR search and dependency download from the Maven repository](/logo.png)
org.crazyyak.dev.common.EnvUtils Maven / Gradle / Ivy
package org.crazyyak.dev.common;
public class EnvUtils {
private EnvUtils() {
}
public static String findProperty(String propertyName) {
return findProperty(propertyName, null);
}
public static String findProperty(String propertyName, String defaultValue) {
String actualValue = getSystemProperty(propertyName);
if (StringUtils.isBlank(actualValue)) {
actualValue = getEnvironmentProperty(propertyName);
}
return (StringUtils.isBlank(actualValue)) ? defaultValue : actualValue;
}
public static String getEnvironmentProperty(String propertyName) {
return System.getenv(propertyName);
}
public static String getEnvironmentProperty(String propertyName, String defaultValue) {
String actualValue = System.getenv(propertyName);
return (StringUtils.isBlank(actualValue)) ? defaultValue : actualValue;
}
public static String getSystemProperty(String propertyName) {
return System.getProperty(propertyName);
}
public static String getSystemProperty(String propertyName, String defaultValue) {
String actualValue = System.getProperty(propertyName);
return (StringUtils.isBlank(actualValue)) ? defaultValue : actualValue;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy