xiejun
2023-10-17 9e341acec731503f1540b65727441e771b8ef9b4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
package com.vci.rmip.code.client.codeapply.Apply410.utils;
import org.apache.commons.lang.StringUtils;
 
import com.vci.base.common.resource.CommonProperties;
 
/**
 * 配置信息统一读取类
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2012</p>
 * <p>Company: VCI</p>
 * @author xchao
 * @time 2013-3-20
 * @version 1.0
 */
public class ConfigUtils {
 
 
    /**
     * 根据KEY,从远程服务器端conf.properties中配置值
     * <p>Description: 根据未找到相应的值,则返回KEY</p>
     *
     * @author xchao
     * @time 2013-3-20
     * @param key
     * @return
     */
    public static String getConfigValue(String key){
        String res=CommonProperties.getStringProperty(key);
        return res;
    }
 
    /**
     * 根据KEY,从远程服务器端conf.properties中配置值
     * <p>Description: 根据未找到相应的值,则返回KEY</p>
     *
     * @author xchao
     * @time 2013-3-20
     * @param key
     * @return
     */
    public static String getConfigValue(String key,String defaultValue){
        String res=CommonProperties.getStringProperty(key);
        if(StringUtils.isBlank(res)){
            return defaultValue;
        }
        return res;
    }
}