yangys
2024-05-08 dc40d10f7d8227d8b8216584ed19e4d41c57f0cd
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);
            }
        }
    }
}