Class PropertiesUtil

  • All Implemented Interfaces:
    org.springframework.beans.factory.InitializingBean

    public class PropertiesUtil
    extends Object
    implements org.springframework.beans.factory.InitializingBean
    Author:
    qinman, zhangchongjie
    Date:
    2022/12/20
    • Constructor Detail

      • PropertiesUtil

        public PropertiesUtil()
    • Method Detail

      • afterPropertiesSet

        public void afterPropertiesSet()
                                throws Exception
        Sets the system properties
        Specified by:
        afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
        Throws:
        Exception
      • getAllProperties

        public Map<String,​String> getAllProperties​(String resourceUrl,
                                                         List<String> list)
        Description: 获取properties文件中的所有内容
        Parameters:
        resourceUrl -
        list -
        Returns:
      • getKeys

        public List<String> getKeys​(String resourceUrl)
        Description: 获取关键字
        Parameters:
        resourceUrl -
        Returns:
      • getProperties

        public Properties getProperties​(String resourceUrl)
        Description: 获取Properties文件
        Parameters:
        resourceUrl -
        Returns:
      • getProperty

        public String getProperty​(String resourceUrl,
                                  String source)
        Description: 获取资源
        Parameters:
        resourceUrl -
        source -
        Returns:
      • save

        public void save​(String resourceUrl,
                         Properties prop)
        Description: 保存
        Parameters:
        resourceUrl -
        prop -
      • savePropertiy

        public void savePropertiy​(String resourceUrl,
                                  String key,
                                  String value)
        Description: 设置修改后的properties的属性
        Parameters:
        resourceUrl -
        key -
        value -
      • setSystemProperties

        public void setSystemProperties​(Map systemProperties)