Spring中PropertiesLoaderUtils应用

        FileSystemResource fileSystemResource =new FileSystemResource("D:/home/conf/mail.properties");
        Properties properties = PropertiesLoaderUtils.loadProperties(fileSystemResource);
        System.out.println("从文件系统读:"+properties);


        ClassPathResource classPathResource = new ClassPathResource("jasperreports.properties");
        Properties properties1 = PropertiesLoaderUtils.loadProperties(classPathResource);
        System.out.println("从类路径读:"+properties1);

微信公众号
在这里插入图片描述

原文地址:https://www.cnblogs.com/niugang0920/p/12185838.html