1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
| package com.qianwen.core.launch.utils;
|
| import java.util.Properties;
| import org.springframework.util.StringUtils;
|
|
| public class PropsUtil {
| public static void setProperty(Properties props, String key, String value) {
| if (StringUtils.isEmpty(props.getProperty(key))) {
| if (System.getenv().containsKey(key)) {
| props.setProperty(key, System.getenv(key));
| } else {
| props.setProperty(key, value);
| }
| }
| }
| }
|
|