Spring code

2.1 Resource 体系

org.springframework.core.io.Resource,对资源的抽象。它的每一个实现类都代表了一种资源的访问策略,如 ClassPathResource、RLResource、FileSystemResource 等。

Spring code

具体源码 保存在github  抽空整理出来 上链接

 

2.1.2 ResourceLoader 体系

有了资源,就应该有资源加载,Spring 利用 org.springframework.core.io.ResourceLoader 来进行统一资源加载,类图如下:

Spring code