类 ConfigUtils
- java.lang.Object
-
- com.alibaba.dubbo.common.utils.ConfigUtils
-
public class ConfigUtils extends Object
-
-
方法概要
所有方法 静态方法 具体方法 修饰符和类型 方法 说明 static voidaddProperties(Properties properties)static intgetPid()static PropertiesgetProperties()static StringgetProperty(String key)static StringgetProperty(String key, String defaultValue)static intgetServerShutdownTimeout()static StringgetSystemProperty(String key)System environment -> System propertiesstatic booleanisDefault(String value)static booleanisEmpty(String value)static booleanisNotEmpty(String value)static PropertiesloadProperties(String fileName)static PropertiesloadProperties(String fileName, boolean allowMultiFile)static PropertiesloadProperties(String fileName, boolean allowMultiFile, boolean optional)Load properties file toPropertiesfrom class path.static List<String>mergeValues(Class<?> type, String cfg, List<String> def)Insert default extension into extension list.static StringreplaceProperty(String expression, Map<String,String> params)static voidsetProperties(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.-foo1will remove default extension 'foo';-defaultwill 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 toPropertiesfrom class path.- 参数:
fileName- properties file name. for example:dubbo.properties,METE-INF/conf/foo.propertiesallowMultiFile- iffalse, throwIllegalStateExceptionwhen found multi file on the class path.optional- is optional. iffalse, log warn when properties config file not found!s- 返回:
- loaded
Propertiescontent.- 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()
-
-