1:读取图片
图片位置在resources下
URL resource1 = getClass().getClassLoader().getResource("1.png");
2:读取配置文件
配置文件在resources下
String path = "code.properties";
EncodedResource encodedResource = new EncodedResource(new ClassPathResource(path),
Charsets.UTF_8);
Properties properties = PropertiesLoaderUtils.loadProperties(encodedResource);
String property = properties.getProperty("name");