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);

微信公众号

JAVA程序猿成长之路
JAVA程序猿成长之路
分享资源,记录程序猿成长点滴。专注于Java,Spring,SpringBoot,SpringCloud,分布式,微服务。

发布了234 篇原创文章 · 获赞 157 · 访问量 41万+

猜你喜欢

转载自blog.csdn.net/niugang0920/article/details/102593846