类 ConfigUtils
- java.lang.Object
-
- com.alibaba.dubbo.common.utils.ConfigUtils
-
public class ConfigUtils extends Object
-
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static void
addProperties(Properties properties)
static int
getPid()
static Properties
getProperties()
static String
getProperty(String key)
static String
getProperty(String key, String defaultValue)
static int
getServerShutdownTimeout()
static String
getSystemProperty(String key)
System environment -> System propertiesstatic boolean
isDefault(String value)
static boolean
isEmpty(String value)
static boolean
isNotEmpty(String value)
static Properties
loadProperties(String fileName)
static Properties
loadProperties(String fileName, boolean allowMultiFile)
static Properties
loadProperties(String fileName, boolean allowMultiFile, boolean optional)
Load properties file toProperties
from class path.static List<String>
mergeValues(Class<?> type, String cfg, List<String> def)
Insert default extension into extension list.static String
replaceProperty(String expression, Map<String,String> params)
static void
setProperties(Properties properties)
-
-
-
方法详细资料
-
isNotEmpty
public static boolean isNotEmpty(String value)
-
isEmpty
public static boolean isEmpty(String value)
-
isDefault
public static boolean isDefault(String value)
-
mergeValues
public static List<String> mergeValues(Class<?> type, String cfg, List<String> def)
Insert default extension into extension list.Extension list support
- Special value
default
, means the location for default extensions. - Special symbol
-
, means remove.-foo1
will remove default extension 'foo';-default
will remove all default extensions.
- 参数:
type
- Extension typecfg
- Extension name listdef
- Default extension list- 返回:
- result extension list
- Special value
-
getProperties
public static Properties getProperties()
-
setProperties
public static void setProperties(Properties properties)
-
addProperties
public static void addProperties(Properties properties)
-
getSystemProperty
public static String getSystemProperty(String key)
System environment -> System properties- 参数:
key
- key- 返回:
- value
-
loadProperties
public static Properties loadProperties(String fileName)
-
loadProperties
public static Properties loadProperties(String fileName, boolean allowMultiFile)
-
loadProperties
public static Properties loadProperties(String fileName, boolean allowMultiFile, boolean optional)
Load properties file toProperties
from class path.- 参数:
fileName
- properties file name. for example:dubbo.properties
,METE-INF/conf/foo.properties
allowMultiFile
- iffalse
, throwIllegalStateException
when found multi file on the class path.optional
- is optional. iffalse
, log warn when properties config file not found!s- 返回:
- loaded
Properties
content.- return empty Properties if no file found.
- merge multi properties file if found multi file
- 抛出:
IllegalStateException
- not allow multi-file, but multi-file exsit on class path.
-
getPid
public static int getPid()
-
getServerShutdownTimeout
public static int getServerShutdownTimeout()
-
-