List springframework classpath


in applicationContext-XX.xml

<bean id="pathMatchingResourcePatternResolver" class="org.springframework.core.io.support.PathMatchingResourcePatternResolver" />

in your class:


	@Autowired
	@Qualifier("pathMatchingResourcePatternResolver")
	private PathMatchingResourcePatternResolver path;

	public void method(...) throws Exception {

		URLClassLoader loader = (URLClassLoader) path.getClassLoader();
		for(URL url: loader.getURLs()){
			System.out.println(url.toString());
		}
		// ...

Anuncios
List springframework classpath