package de.juplo.demo.httpresources;
+import de.juplo.httpresources.HttpResourceChainAwareResourceLoader;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
+import org.springframework.context.support.GenericApplicationContext;
+import org.springframework.core.io.support.PathMatchingResourcePatternResolver;
import org.springframework.http.client.ClientHttpRequestFactory;
import org.springframework.http.client.HttpComponentsClientHttpRequestFactory;
return new HttpComponentsClientHttpRequestFactory();
}
+ @Bean
+ HttpResourceChainAwareResourceLoader resourceLoader(
+ GenericApplicationContext context,
+ String[] sources) {
+ HttpResourceChainAwareResourceLoader loader =
+ new HttpResourceChainAwareResourceLoader(
+ new PathMatchingResourcePatternResolver(),
+ sources
+ );
+ context.setResourceLoader(loader);
+ return loader;
+ }
+
public static void main(String[] args)
{