import org.springframework.core.io.Resource; import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
PathMatchingResourcePatternResolver resolver = new PathMatchingResourcePatternResolver(); Resource resource = resolver.getResource("classpath:test.dat"); Resource resource2 = resolver.getResource("file:C:/test.dat"); Resource resource3 = resolver.getResource("WEB-INF/test.dat");
|