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程序猿成长之路

posted @ 2020-01-13 14:13  盲目的拾荒者  阅读(125)  评论(0编辑  收藏  举报