Home / Class/ WebResourcesRuntimeHints Class — spring-boot Architecture

WebResourcesRuntimeHints Class — spring-boot Architecture

Architecture documentation for the WebResourcesRuntimeHints class in WebResourcesRuntimeHints.java from the spring-boot codebase.

Entity Profile

Source Code

core/spring-boot-autoconfigure/src/main/java/org/springframework/boot/autoconfigure/web/WebResourcesRuntimeHints.java lines 32–49

public class WebResourcesRuntimeHints implements RuntimeHintsRegistrar {

	private static final List<String> DEFAULT_LOCATIONS = List.of("META-INF/resources/", "resources/", "static/",
			"public/");

	@Override
	public void registerHints(RuntimeHints hints, @Nullable ClassLoader classLoader) {
		ClassLoader classLoaderToUse = (classLoader != null) ? classLoader : getClass().getClassLoader();
		String[] locations = DEFAULT_LOCATIONS.stream()
			.filter((candidate) -> classLoaderToUse.getResource(candidate) != null)
			.map((location) -> location + "**")
			.toArray(String[]::new);
		if (locations.length > 0) {
			hints.resources().registerPattern((hint) -> hint.includes(locations));
		}
	}

}

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free