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);
微信公众号