类 ConfigUtils


  • public class ConfigUtils
    extends Object
    • 方法详细资料

      • 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 type
        cfg - Extension name list
        def - Default extension list
        返回:
        result extension list
      • getProperties

        public static Properties getProperties()
      • setProperties

        public static void setProperties​(Properties properties)
      • addProperties

        public static void addProperties​(Properties properties)
      • getProperty

        public static String getProperty​(String key)
      • getSystemProperty

        public static String getSystemProperty​(String key)
        System environment -> System properties
        参数:
        key - key
        返回:
        value
      • loadProperties

        public static Properties loadProperties​(String fileName,
                                                boolean allowMultiFile)
      • loadProperties

        public static Properties loadProperties​(String fileName,
                                                boolean allowMultiFile,
                                                boolean optional)
        Load properties file to Properties from class path.
        参数:
        fileName - properties file name. for example: dubbo.properties, METE-INF/conf/foo.properties
        allowMultiFile - if false, throw IllegalStateException when found multi file on the class path.
        optional - is optional. if false, 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()